]>
Commit | Line | Data |
---|---|---|
ec0603e1 JH |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2007 Junio C Hamano | |
4 | ||
5 | test_description='git checkout to switch between branches with symlink<->dir' | |
6 | ||
7 | . ./test-lib.sh | |
8 | ||
704a3143 JS |
9 | if ! test_have_prereq SYMLINKS |
10 | then | |
11 | say "symbolic links not supported - skipping tests" | |
12 | test_done | |
13 | fi | |
14 | ||
ec0603e1 JH |
15 | test_expect_success setup ' |
16 | ||
17 | mkdir frotz && | |
18 | echo hello >frotz/filfre && | |
19 | git add frotz/filfre && | |
20 | test_tick && | |
21 | git commit -m "master has file frotz/filfre" && | |
22 | ||
23 | git branch side && | |
24 | ||
25 | echo goodbye >nitfol && | |
26 | git add nitfol | |
27 | test_tick && | |
28 | git commit -m "master adds file nitfol" && | |
29 | ||
30 | git checkout side && | |
31 | ||
32 | git rm --cached frotz/filfre && | |
33 | mv frotz xyzzy && | |
34 | ln -s xyzzy frotz && | |
35 | git add xyzzy/filfre frotz && | |
36 | test_tick && | |
37 | git commit -m "side moves frotz/ to xyzzy/ and adds frotz->xyzzy/" | |
38 | ||
39 | ' | |
40 | ||
41 | test_expect_success 'switch from symlink to dir' ' | |
42 | ||
43 | git checkout master | |
44 | ||
45 | ' | |
46 | ||
47 | rm -fr frotz xyzzy nitfol && | |
48 | git checkout -f master || exit | |
49 | ||
50 | test_expect_success 'switch from dir to symlink' ' | |
51 | ||
52 | git checkout side | |
53 | ||
54 | ' | |
55 | ||
56 | test_done |