X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft1001-read-tree-m-2way.sh;h=93ca84f9e6d3dfd859d8bd4941f4d2c5a354ab6c;hb=633142d86874ee8ce79a23ee4346f32e6271faad;hp=6327d205cb89b00e77502031e3b56b4b895cc32d;hpb=8165952517bf82b6a632cefc047ad14f36a74b25;p=git.git diff --git a/t/t1001-read-tree-m-2way.sh b/t/t1001-read-tree-m-2way.sh index 6327d205c..93ca84f9e 100755 --- a/t/t1001-read-tree-m-2way.sh +++ b/t/t1001-read-tree-m-2way.sh @@ -359,7 +359,7 @@ test_expect_success \ test_expect_success \ 'a/b (untracked) vs a, plus c/d case test.' \ - '! git read-tree -u -m "$treeH" "$treeM" && + 'test_must_fail git read-tree -u -m "$treeH" "$treeM" && git ls-files --stage && test -f a/b' @@ -390,4 +390,20 @@ test_expect_success \ git ls-files --stage | tee >treeMcheck.out && test_cmp treeM.out treeMcheck.out' +test_expect_success '-m references the correct modified tree' ' + echo >file-a && + echo >file-b && + git add file-a file-b && + git commit -a -m "test for correct modified tree" + git branch initial-mod && + echo b >file-b && + git commit -a -m "B" && + echo a >file-a && + git add file-a && + git ls-tree $(git write-tree) file-a >expect && + git read-tree -m HEAD initial-mod && + git ls-tree $(git write-tree) file-a >actual && + test_cmp expect actual +' + test_done