author | Brandon Casey <casey@nrlssc.navy.mil> | |
Tue, 23 Sep 2008 23:57:09 +0000 (18:57 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Wed, 24 Sep 2008 16:24:20 +0000 (09:24 -0700) | ||
commit | da65e7c133cd316c9076fbb6b0aeee7bc42a6db8 | |
tree | bc8847c0e04aa5f469971219a5e76f1db14ac853 | tree | snapshot |
parent | dc4179f9a76473176eb473f6f568b0006c823fba | commit | diff |
git-stash.sh: don't default to refs/stash if invalid ref supplied
apply_stash() and show_stash() each call rev-parse with
'--default refs/stash' as an argument. This option causes rev-parse to
operate on refs/stash if it is not able to successfully operate on any
element of the command line. This includes failure to supply a "valid"
revision. This has the effect of causing 'stash apply' and 'stash show'
to operate as if stash@{0} had been supplied when an invalid revision is
supplied.
e.g. 'git stash apply stash@{1}' would fall back to
'git stash apply stash@{0}'
This patch modifies these two functions so that they avoid using the
--default option of rev-parse.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
apply_stash() and show_stash() each call rev-parse with
'--default refs/stash' as an argument. This option causes rev-parse to
operate on refs/stash if it is not able to successfully operate on any
element of the command line. This includes failure to supply a "valid"
revision. This has the effect of causing 'stash apply' and 'stash show'
to operate as if stash@{0} had been supplied when an invalid revision is
supplied.
e.g. 'git stash apply stash@{1}' would fall back to
'git stash apply stash@{0}'
This patch modifies these two functions so that they avoid using the
--default option of rev-parse.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-stash.sh | diff | blob | history |