Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/t2007-checkout-symlink.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / t2007-checkout-symlink.sh` 55 lines ยท 1016 bytes Raw Blame History 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 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main 8 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME 9 10 . ./test-lib.sh 11 12 test_expect_success setup ' 13 14 mkdir frotz && 15 echo hello >frotz/filfre && 16 git add frotz/filfre && 17 test_tick && 18 git commit -m "main has file frotz/filfre" && 19 20 git branch side && 21 22 echo goodbye >nitfol && 23 git add nitfol && 24 test_tick && 25 git commit -m "main adds file nitfol" && 26 27 git checkout side && 28 29 git rm --cached frotz/filfre && 30 mv frotz xyzzy && 31 test_ln_s_add xyzzy frotz && 32 git add xyzzy/filfre && 33 test_tick && 34 git commit -m "side moves frotz/ to xyzzy/ and adds frotz->xyzzy/" 35 36 ' 37 38 test_expect_success 'switch from symlink to dir' ' 39 40 git checkout main 41 42 ' 43 44 test_expect_success 'Remove temporary directories & switch to main' ' 45 rm -fr frotz xyzzy nitfol && 46 git checkout -f main 47 ' 48 49 test_expect_success 'switch from dir to symlink' ' 50 51 git checkout side 52 53 ' 54 55 test_done