diff options
author | Brandon Casey <casey@nrlssc.navy.mil> | 2008-10-02 18:52:11 -0500 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2008-10-09 09:09:50 -0700 |
commit | 875471c510b29f920693834b43a992c99694af58 (patch) | |
tree | 4ce22f25998be2705054fd874f78acd074f1b699 /dir.h | |
parent | Merge branch 'jk/maint-soliconv' into maint (diff) | |
download | tgif-875471c510b29f920693834b43a992c99694af58.tar.xz |
git-stash.sh: fix flawed fix of invalid ref handling (commit da65e7c1)
The referenced commit tried to fix a flaw in stash's handling of a user
supplied invalid ref. i.e. 'git stash apply fake_ref@{0}' should fail
instead of applying stash@{0}. But, it did so in a naive way by avoiding the
use of the --default option of rev-parse, and instead manually supplied the
default revision if the user supplied an empty command line. This prevented
a common usage scenario of supplying flags on the stash command line (i.e.
non-empty command line) which would be parsed by lower level git commands,
without supplying a specific revision. This should fall back to the default
revision, but now it causes an error. e.g. 'git stash show -p'
The correct fix is to use the --verify option of rev-parse, which fails
properly if an invalid ref is supplied, and still allows falling back to a
default ref when one is not supplied.
Convert stash-drop to use --verify while we're at it, since specifying
multiple revisions for any of these commands is also an error and --verify
makes it so.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'dir.h')
0 files changed, 0 insertions, 0 deletions