• Thomas Rast's avatar
    stash pop: remove 'apply' options during 'drop' invocation · 460ccd0e
    Thomas Rast authored
    The 'git stash pop' option parsing used to remove the first argument
    in --index mode.  At the time this was implemented, this first
    argument was always --index.  However, since the invention of the -q
    option in fcdd0e92 (stash: teach quiet option, 2009-06-17) you can
    cause an internal invocation of
      git stash drop --index
    by running
      git stash pop -q --index
    which then of course fails because drop doesn't know --index.
    To handle this, instead let 'git stash apply' decide what the future
    argument to 'drop' should be.
    Warning: this means that 'git stash apply' must parse all options that
    'drop' can take, and deal with them in the same way.  This is
    currently true for its only option -q.
    Signed-off-by: default avatarThomas Rast <[email protected]>
    Acked-by: default avatarStephen Boyd <[email protected]>
    Signed-off-by: default avatarJunio C Hamano <[email protected]>
git-stash.sh 8.56 KB