{"thread":{"id":"8807","subject":"[PATCH] Test 'git add' for unmerged entries when core.symlinks=false.","startedAt":"2007-07-02T11:28:42Z","lastAt":"2007-07-02T11:28:42Z","messageCount":1,"participants":["Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"46228","messageId":"1183375722665-git-send-email-johannes.sixt@telecom.at","threadId":"8807","inReplyTo":null,"subject":"[PATCH] Test 'git add' for unmerged entries when core.symlinks=false.","fromName":"Johannes Sixt","fromEmail":"johannes.sixt@telecom.at","sentAt":"2007-07-02T11:28:42Z","receivedAt":"2007-07-02T11:28:42Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"In 20314271679e169f324c118c69c8d9e0399feec9 git add was fixed if unmerged\nentries are in the index and core.filemode=false. core.symlinks=false is\na similar case, which touches the same code path. Here is a test that\nmakes sure that the symlink property in the index is preserved, too.\n\nSigned-off-by: Johannes Sixt <johannes.sixt@telecom.at>\n---\n t/t3700-add.sh |   27 +++++++++++++++++----------\n 1 files changed, 17 insertions(+), 10 deletions(-)\n\ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex 0d80c6a..e6466d7 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -110,30 +110,37 @@ test_expect_success 'check correct prefix detection' '\n \tgit add 1/2/a 1/3/b 1/2/c\n '\n \n-test_expect_success 'git add and filemode=0 with unmerged entries' '\n-\techo 1 > stage1 &&\n-\techo 2 > stage2 &&\n-\techo 3 > stage3 &&\n+test_expect_success 'git add with filemode=0, symlinks=0, and unmerged entries' '\n \tfor s in 1 2 3\n \tdo\n+\t\techo $s > stage$s\n \t\techo \"100755 $(git hash-object -w stage$s) $s\tfile\"\n+\t\techo \"120000 $(printf $s | git hash-object -w -t blob --stdin) $s\tsymlink\"\n \tdone | git update-index --index-info &&\n \tgit config core.filemode 0 &&\n+\tgit config core.symlinks 0 &&\n \techo new > file &&\n-\tgit add file &&\n-\tgit ls-files --stage | grep \"^100755 .* 0\tfile$\"\n+\techo new > symlink &&\n+\tgit add file symlink &&\n+\tgit ls-files --stage | grep \"^100755 .* 0\tfile$\" &&\n+\tgit ls-files --stage | grep \"^120000 .* 0\tsymlink$\"\n '\n \n-test_expect_success 'git add and filemode=0 prefers stage 2 over stage 1' '\n-\tgit rm --cached -f file &&\n+test_expect_success 'git add with filemode=0, symlinks=0 prefers stage 2 over stage 1' '\n+\tgit rm --cached -f file symlink &&\n \t(\n \t\techo \"100644 $(git hash-object -w stage1) 1\tfile\"\n \t\techo \"100755 $(git hash-object -w stage2) 2\tfile\"\n+\t\techo \"100644 $(printf $s | git hash-object -w -t blob --stdin) 1\tsymlink\"\n+\t\techo \"120000 $(printf $s | git hash-object -w -t blob --stdin) 2\tsymlink\"\n \t) | git update-index --index-info &&\n \tgit config core.filemode 0 &&\n+\tgit config core.symlinks 0 &&\n \techo new > file &&\n-\tgit add file &&\n-\tgit ls-files --stage | grep \"^100755 .* 0\tfile$\"\n+\techo new > symlink &&\n+\tgit add file symlink &&\n+\tgit ls-files --stage | grep \"^100755 .* 0\tfile$\" &&\n+\tgit ls-files --stage | grep \"^120000 .* 0\tsymlink$\"\n '\n \n test_done\n-- \n1.5.2.2.555.g24e57\n"}]}