Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
t1005: add test for "read-tree --reset -u A B"
author
Junio C Hamano
<gitster@pobox.com>
Fri, 1 Nov 2013 22:04:08 +0000
(15:04 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 4 Nov 2013 18:13:45 +0000
(10:13 -0800)
With a conflicted index, this used to give us an error.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1005-read-tree-reset.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
76da5b1
)
diff --git
a/t/t1005-read-tree-reset.sh
b/t/t1005-read-tree-reset.sh
index e29cf635995bffa72515fd1133157d73b08d943e..074568500a357d3bae69a953aa59155687483a10 100755
(executable)
--- 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 -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 &&
test_expect_success 'Porcelain reset should remove remnants too' '
read_tree_u_must_succeed --reset -u HEAD &&
git ls-files -s >expect &&