1#!/bin/sh
   2#
   3# Copyright (c) 2007 Junio C Hamano
   4test_description='git checkout to switch between branches with symlink<->dir'
   6. ./test-lib.sh
   8test_expect_success SYMLINKS setup '
  10        mkdir frotz &&
  12        echo hello >frotz/filfre &&
  13        git add frotz/filfre &&
  14        test_tick &&
  15        git commit -m "master has file frotz/filfre" &&
  16        git branch side &&
  18        echo goodbye >nitfol &&
  20        git add nitfol &&
  21        test_tick &&
  22        git commit -m "master adds file nitfol" &&
  23        git checkout side &&
  25        git rm --cached frotz/filfre &&
  27        mv frotz xyzzy &&
  28        ln -s xyzzy frotz &&
  29        git add xyzzy/filfre frotz &&
  30        test_tick &&
  31        git commit -m "side moves frotz/ to xyzzy/ and adds frotz->xyzzy/"
  32'
  34test_expect_success SYMLINKS 'switch from symlink to dir' '
  36        git checkout master
  38'
  40test_expect_success SYMLINKS 'Remove temporary directories & switch to master' '
  42        rm -fr frotz xyzzy nitfol &&
  43        git checkout -f master
  44'
  45test_expect_success SYMLINKS 'switch from dir to symlink' '
  47        git checkout side
  49'
  51test_done