summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-11-11 23:19:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-11-11 23:19:24 (GMT)
commit52b9b48a2c0cfd703cf95ae8b4913544c5497aba (patch)
tree6cfa6913b0f980f291d3e2bddb9f3b5b25b47c5b /t
parent91febfba6f86e77c0ed320ecf7d0704be13c25fe (diff)
parent620a6cd42ed5ea94684b22714181bf03871733dd (diff)
downloadgit-52b9b48a2c0cfd703cf95ae8b4913544c5497aba.zip
git-52b9b48a2c0cfd703cf95ae8b4913544c5497aba.tar.gz
git-52b9b48a2c0cfd703cf95ae8b4913544c5497aba.tar.bz2
Merge branch 'js/reset'
* js/reset: builtin-reset: avoid forking "update-index --refresh" builtin-reset: do not call "ls-files --unmerged"
Diffstat (limited to 't')
-rwxr-xr-xt/t7102-reset.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh
index cea9afb..e5c9f30 100755
--- a/t/t7102-reset.sh
+++ b/t/t7102-reset.sh
@@ -59,6 +59,15 @@ test_expect_success 'giving a non existing revision should fail' '
check_changes 3ec39651e7f44ea531a5de18a9fa791c0fd370fc
'
+test_expect_success 'reset --soft with unmerged index should fail' '
+ touch .git/MERGE_HEAD &&
+ echo "100644 44c5b5884550c17758737edcced463447b91d42b 1 un" |
+ git update-index --index-info &&
+ ! git reset --soft HEAD &&
+ rm .git/MERGE_HEAD &&
+ git rm --cached -- un
+'
+
test_expect_success \
'giving paths with options different than --mixed should fail' '
! git reset --soft -- first &&
@@ -409,4 +418,14 @@ test_expect_success 'resetting an unmodified path is a no-op' '
git diff-index --cached --exit-code HEAD
'
+cat > expect << EOF
+file2: needs update
+EOF
+
+test_expect_success '--mixed refreshes the index' '
+ echo 123 >> file2 &&
+ git reset --mixed HEAD > output &&
+ git diff --exit-code expect output
+'
+
test_done