summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3fcb887)
raw | patch | inline | side by side (parent: 3fcb887)
author | Brian Gernhardt <brian@gernhardtsoftware.com> | |
Fri, 24 Sep 2010 22:15:34 +0000 (18:15 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 27 Sep 2010 04:27:37 +0000 (21:27 -0700) |
Currently git-stash uses `git rev-parse --no-revs -- "$@"` to set its
FLAGS variable. This is the same as `FLAGS="-- $@"`. It should use
`git rev-parse --no-revs --flags "$@"`, but that eats any "-q" or
"--quiet" argument. So move the check for quiet before rev-parse.
Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
FLAGS variable. This is the same as `FLAGS="-- $@"`. It should use
`git rev-parse --no-revs --flags "$@"`, but that eats any "-q" or
"--quiet" argument. So move the check for quiet before rev-parse.
Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-stash.sh | patch | blob | history | |
t/t3903-stash.sh | patch | blob | history |
diff --git a/git-stash.sh b/git-stash.sh
index 7ce818bd1baecfb48447f862bb2654ccbd3cf2ff..57f36ce8dd7cd25e269f8e31d6fdc668d62811f9 100755 (executable)
--- a/git-stash.sh
+++ b/git-stash.sh
b_tree=
i_tree=
+ # Work around rev-parse --flags eating -q
+ for opt
+ do
+ case "$opt" in
+ -q|--quiet)
+ GIT_QUIET=t
+ ;;
+ esac
+ done
+
REV=$(git rev-parse --no-flags --symbolic "$@" 2>/dev/null)
- FLAGS=$(git rev-parse --no-revs -- "$@" 2>/dev/null)
+ FLAGS=$(git rev-parse --no-revs --flags "$@" 2>/dev/null)
set -- $FLAGS
while test $# -ne 0
do
case "$1" in
- -q|--quiet)
- GIT_QUIET=-t
- ;;
--index)
INDEX_OPTION=--index
;;
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index e8a7338862b472a1eeb0a54313e897fcd209741e..9ed2396e29fb6f573f32e12c1dd4182086d60b04 100755 (executable)
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
test $(git ls-files --modified | wc -l) -eq 1
'
-test_expect_failure 'stash show - stashes on stack, stash-like argument' '
+test_expect_success 'stash show - stashes on stack, stash-like argument' '
git stash clear &&
test_when_finished "git reset --hard HEAD" &&
git reset --hard &&
test_cmp expected actual
'
-test_expect_failure 'stash show -p - stashes on stack, stash-like argument' '
+test_expect_success 'stash show -p - stashes on stack, stash-like argument' '
git stash clear &&
test_when_finished "git reset --hard HEAD" &&
git reset --hard &&
test_cmp expected actual
'
-test_expect_failure 'stash show - no stashes on stack, stash-like argument' '
+test_expect_success 'stash show - no stashes on stack, stash-like argument' '
git stash clear &&
test_when_finished "git reset --hard HEAD" &&
git reset --hard &&
test_cmp expected actual
'
-test_expect_failure 'stash show -p - no stashes on stack, stash-like argument' '
+test_expect_success 'stash show -p - no stashes on stack, stash-like argument' '
git stash clear &&
test_when_finished "git reset --hard HEAD" &&
git reset --hard &&