summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2022-06-28 22:22:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-06-28 22:37:50 (GMT)
commit4788e8b25692a8ae1a005554d3ad12f8ee4ee29e (patch)
tree3d2ba891cef3da768888cbc8b1d2001beef9a2fc /t
parent3beff388b2accbc474383d38ef12d4fe31152abc (diff)
downloadgit-4788e8b25692a8ae1a005554d3ad12f8ee4ee29e.zip
git-4788e8b25692a8ae1a005554d3ad12f8ee4ee29e.tar.gz
git-4788e8b25692a8ae1a005554d3ad12f8ee4ee29e.tar.bz2
add --interactive: allow `update` to stage deleted files
The scripted version of `git add -i` used `git update-index --add --remove`, but the built-in version implemented only the `--add` part. This fixes https://github.com/msys2/MSYS2-packages/issues/3066 Reported-by: Christoph Reiter <reiter.christoph@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t3701-add-interactive.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
index d4f9386..02c919c 100755
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@ -71,6 +71,15 @@ test_expect_success 'status works (commit)' '
grep "+1/-0 *+2/-0 file" output
'
+test_expect_success 'update can stage deletions' '
+ >to-delete &&
+ git add to-delete &&
+ rm to-delete &&
+ test_write_lines u t "" | git add -i &&
+ git ls-files to-delete >output &&
+ test_must_be_empty output
+'
+
test_expect_success 'setup expected' '
cat >expected <<-\EOF
index 180b47c..b6f2c08 100644