Code

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