summaryrefslogtreecommitdiff
path: root/t/t7111-reset-table.sh
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2010-01-19 04:25:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-01-25 01:46:41 (GMT)
commitffbc5dc2d0cbdbd63a4ae04dc2cc1ebf385fcc25 (patch)
treec73f84fd521a7097a97f3893bbf5c5e89b200691 /t/t7111-reset-table.sh
parent9bc454df08ca2a27b51ac0ab9ff8f154e51b8698 (diff)
downloadgit-ffbc5dc2d0cbdbd63a4ae04dc2cc1ebf385fcc25.zip
git-ffbc5dc2d0cbdbd63a4ae04dc2cc1ebf385fcc25.tar.gz
git-ffbc5dc2d0cbdbd63a4ae04dc2cc1ebf385fcc25.tar.bz2
reset: add test cases for "--keep" option
This shows that with the "--keep" option, changes that are both in the work tree and the index are kept in the work tree after the reset (but discarded in the index). In the case of unmerged entries, we can see that "git reset --keep" works only when the target state is the same as HEAD. And then the work tree is not reset. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7111-reset-table.sh')
-rwxr-xr-xt/t7111-reset-table.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t7111-reset-table.sh b/t/t7111-reset-table.sh
index de896c9..2ebda97 100755
--- a/t/t7111-reset-table.sh
+++ b/t/t7111-reset-table.sh
@@ -44,26 +44,32 @@ A B C D soft A B D
A B C D mixed A D D
A B C D hard D D D
A B C D merge XXXXX
+A B C D keep XXXXX
A B C C soft A B C
A B C C mixed A C C
A B C C hard C C C
A B C C merge XXXXX
+A B C C keep A C C
B B C D soft B B D
B B C D mixed B D D
B B C D hard D D D
B B C D merge D D D
+B B C D keep XXXXX
B B C C soft B B C
B B C C mixed B C C
B B C C hard C C C
B B C C merge C C C
+B B C C keep B C C
B C C D soft B C D
B C C D mixed B D D
B C C D hard D D D
B C C D merge XXXXX
+B C C D keep XXXXX
B C C C soft B C C
B C C C mixed B C C
B C C C hard C C C
B C C C merge B C C
+B C C C keep B C C
EOF
test_expect_success 'setting up branches to test with unmerged entries' '
@@ -104,10 +110,12 @@ X U B C soft XXXXX
X U B C mixed X C C
X U B C hard C C C
X U B C merge C C C
+X U B C keep XXXXX
X U B B soft XXXXX
X U B B mixed X B B
X U B B hard B B B
X U B B merge B B B
+X U B B keep X B B
EOF
test_done