summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rwxr-xr-xt/t7102-reset.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh
index 8d4b50d1b5..bc0846f435 100755
--- a/t/t7102-reset.sh
+++ b/t/t7102-reset.sh
@@ -535,4 +535,19 @@ test_expect_success 'reset with paths accepts tree' '
git diff HEAD --exit-code
'
+test_expect_success 'reset -N keeps removed files as intent-to-add' '
+ echo new-file >new-file &&
+ git add new-file &&
+ git reset -N HEAD &&
+
+ tree=$(git write-tree) &&
+ git ls-tree $tree new-file >actual &&
+ >expect &&
+ test_cmp expect actual &&
+
+ git diff --name-only >actual &&
+ echo new-file >expect &&
+ test_cmp expect actual
+'
+
test_done