X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft2200-add-update.sh;h=f57a6e077c3b85dcdedc3f4813150feebc8e647d;hb=ac083c47ea226b470afab39d975e718a475a3c78;hp=24f892f79386478fd5f1162654cb9b72d940bbe4;hpb=d794d9e70ebb8c767b04f25c03290ef305cd31ab;p=git.git diff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh index 24f892f79..f57a6e077 100755 --- a/t/t2200-add-update.sh +++ b/t/t2200-add-update.sh @@ -62,7 +62,7 @@ test_expect_success 'cache tree has not been corrupted' ' sed -e "s/ 0 / /" >expect && git ls-tree -r $(git write-tree) | sed -e "s/ blob / /" >current && - diff -u expect current + test_cmp expect current ' @@ -111,4 +111,21 @@ test_expect_success 'touch and then add explicitly' ' ' +test_expect_success 'add -n -u should not add but just report' ' + + ( + echo "add '\''check'\''" && + echo "remove '\''top'\''" + ) >expect && + before=$(git ls-files -s check top) && + echo changed >>check && + rm -f top && + git add -n -u >actual && + after=$(git ls-files -s check top) && + + test "$before" = "$after" && + test_cmp expect actual + +' + test_done