Code

git-add--interactive: manual hunk editing mode
[git.git] / t / t2200-add-update.sh
index 24f892f79386478fd5f1162654cb9b72d940bbe4..f57a6e077c3b85dcdedc3f4813150feebc8e647d 100755 (executable)
@@ -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