t7510: test verify-commit
[git/raj.git] / t / t2007-checkout-symlink.sh
blobfc9aad530e9f9078e95d99da5c1d0849e489d4cf
1 #!/bin/sh
3 # Copyright (c) 2007 Junio C Hamano
5 test_description='git checkout to switch between branches with symlink<->dir'
7 . ./test-lib.sh
9 test_expect_success setup '
11 mkdir frotz &&
12 echo hello >frotz/filfre &&
13 git add frotz/filfre &&
14 test_tick &&
15 git commit -m "master has file frotz/filfre" &&
17 git branch side &&
19 echo goodbye >nitfol &&
20 git add nitfol &&
21 test_tick &&
22 git commit -m "master adds file nitfol" &&
24 git checkout side &&
26 git rm --cached frotz/filfre &&
27 mv frotz xyzzy &&
28 test_ln_s_add xyzzy frotz &&
29 git add xyzzy/filfre &&
30 test_tick &&
31 git commit -m "side moves frotz/ to xyzzy/ and adds frotz->xyzzy/"
35 test_expect_success 'switch from symlink to dir' '
37 git checkout master
41 test_expect_success 'Remove temporary directories & switch to master' '
42 rm -fr frotz xyzzy nitfol &&
43 git checkout -f master
46 test_expect_success 'switch from dir to symlink' '
48 git checkout side
52 test_done