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/t2102-update-index-symlinks.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 / t2102-update-index-symlinks.sh` 31 lines ยท 802 bytes Raw Blame History 1 #!/bin/sh 2 # 3 # Copyright (c) 2007 Johannes Sixt 4 # 5 6 test_description='git update-index on filesystem w/o symlinks test. 7 8 This tests that git update-index keeps the symbolic link property 9 even if a plain file is in the working tree if core.symlinks is false.' 10 11 . ./test-lib.sh 12 13 test_expect_success \ 14 'preparation' ' 15 git config core.symlinks false && 16 l=$(printf file | git hash-object -t blob -w --stdin) && 17 echo "120000 $l symlink" | git update-index --index-info' 18 19 test_expect_success \ 20 'modify the symbolic link' ' 21 printf new-file > symlink && 22 git update-index symlink' 23 24 test_expect_success \ 25 'the index entry must still be a symbolic link' ' 26 case "$(git ls-files --stage --cached symlink)" in 27 120000" "*symlink) echo pass;; 28 *) echo fail; git ls-files --stage --cached symlink; false;; 29 esac' 30 31 test_done