aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-11-01 15:04:08 -0700
committerJunio C Hamano <gitster@pobox.com>2013-11-04 10:13:45 -0800
commit77b43cac9feac1079f3643988cfadee63e4365f7 (patch)
tree8112c8d1a622fea00458aa3f9c29247e704465ea /t
parent76da5b1d22a7f0e3e34a780df91717e6269e84b4 (diff)
downloadgit-77b43cac9feac1079f3643988cfadee63e4365f7.tar.gz
git-77b43cac9feac1079f3643988cfadee63e4365f7.tar.xz
t1005: add test for "read-tree --reset -u A B"
With a conflicted index, this used to give us an error. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t1005-read-tree-reset.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t1005-read-tree-reset.sh b/t/t1005-read-tree-reset.sh
index e29cf6359..074568500 100755
--- a/t/t1005-read-tree-reset.sh
+++ b/t/t1005-read-tree-reset.sh
@@ -43,6 +43,21 @@ test_expect_success 'reset should remove remnants from a failed merge' '
! test -f old
'
+test_expect_success 'two-way reset should remove remnants too' '
+ read_tree_u_must_succeed --reset -u HEAD &&
+ git ls-files -s >expect &&
+ sha1=$(git rev-parse :new) &&
+ (
+ echo "100644 $sha1 1 old"
+ echo "100644 $sha1 3 old"
+ ) | git update-index --index-info &&
+ >old &&
+ git ls-files -s &&
+ read_tree_u_must_succeed --reset -u HEAD HEAD &&
+ git ls-files -s >actual &&
+ ! test -f old
+'
+
test_expect_success 'Porcelain reset should remove remnants too' '
read_tree_u_must_succeed --reset -u HEAD &&
git ls-files -s >expect &&