]>
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 | ||
883b98ef | 7 | GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main |
334afbc7 JS |
8 | export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME |
9 | ||
ec0603e1 JH |
10 | . ./test-lib.sh |
11 | ||
889c6f0e | 12 | test_expect_success setup ' |
ec0603e1 JH |
13 | |
14 | mkdir frotz && | |
15 | echo hello >frotz/filfre && | |
16 | git add frotz/filfre && | |
17 | test_tick && | |
883b98ef | 18 | git commit -m "main has file frotz/filfre" && |
ec0603e1 JH |
19 | |
20 | git branch side && | |
21 | ||
22 | echo goodbye >nitfol && | |
a48fcd83 | 23 | git add nitfol && |
ec0603e1 | 24 | test_tick && |
883b98ef | 25 | git commit -m "main adds file nitfol" && |
ec0603e1 JH |
26 | |
27 | git checkout side && | |
28 | ||
29 | git rm --cached frotz/filfre && | |
30 | mv frotz xyzzy && | |
889c6f0e JS |
31 | test_ln_s_add xyzzy frotz && |
32 | git add xyzzy/filfre && | |
ec0603e1 JH |
33 | test_tick && |
34 | git commit -m "side moves frotz/ to xyzzy/ and adds frotz->xyzzy/" | |
35 | ||
36 | ' | |
37 | ||
889c6f0e | 38 | test_expect_success 'switch from symlink to dir' ' |
ec0603e1 | 39 | |
883b98ef | 40 | git checkout main |
ec0603e1 JH |
41 | |
42 | ' | |
43 | ||
883b98ef | 44 | test_expect_success 'Remove temporary directories & switch to main' ' |
621fd7a2 | 45 | rm -fr frotz xyzzy nitfol && |
883b98ef | 46 | git checkout -f main |
621fd7a2 | 47 | ' |
ec0603e1 | 48 | |
889c6f0e | 49 | test_expect_success 'switch from dir to symlink' ' |
ec0603e1 JH |
50 | |
51 | git checkout side | |
52 | ||
53 | ' | |
54 | ||
55 | test_done |