summaryrefslogtreecommitdiff
path: root/t/t7102-reset.sh
diff options
context:
space:
mode:
authorMartin von Zweigbergk <martinvonz@gmail.com>2013-01-15 05:47:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-01-15 17:38:08 (GMT)
commit2f328c3d2e88230a236e3d84d2bd6de59aea578d (patch)
treea0165cd060114a602a683432d2df9ff49d610ebc /t/t7102-reset.sh
parent7637df131ec9939b737ca284874478cb5c899348 (diff)
downloadgit-2f328c3d2e88230a236e3d84d2bd6de59aea578d.zip
git-2f328c3d2e88230a236e3d84d2bd6de59aea578d.tar.gz
git-2f328c3d2e88230a236e3d84d2bd6de59aea578d.tar.bz2
reset $sha1 $pathspec: require $sha1 only to be treeish
Resetting with paths does not update HEAD and there is nothing else that a commit should be needed for. Relax the argument parsing so only a tree is required. The sha1 is only passed to read_from_tree(), which already only requires a tree. The "rev" variable we pass to run_add_interactive() will resolve to a tree. This is fine since interactive_reset only needs the parameter to be a treeish and doesn't use it for display purposes. Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7102-reset.sh')
-rwxr-xr-xt/t7102-reset.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh
index 81b2570..1fa2a5f 100755
--- a/t/t7102-reset.sh
+++ b/t/t7102-reset.sh
@@ -497,4 +497,12 @@ test_expect_success 'disambiguation (4)' '
test ! -f secondfile
'
+test_expect_success 'reset with paths accepts tree' '
+ # for simpler tests, drop last commit containing added files
+ git reset --hard HEAD^ &&
+ git reset HEAD^^{tree} -- . &&
+ git diff --cached HEAD^ --exit-code &&
+ git diff HEAD --exit-code
+'
+
test_done