diff options
| author | Phillip Wood <phillip.wood@dunelm.org.uk> | 2025-06-07 10:45:26 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-06-07 10:37:17 -0700 |
| commit | 468817bab2ab5fd9b71a8df49e02b8d5521b1631 (patch) | |
| tree | bf22715d92d4e35794cd3104ffeedcacb60d01ca /commit-graph.c | |
| parent | stash: allow "git stash -p <pathspec>" to assume push again (diff) | |
| download | git-468817bab2ab5fd9b71a8df49e02b8d5521b1631.tar.gz git-468817bab2ab5fd9b71a8df49e02b8d5521b1631.zip | |
stash: allow "git stash [<options>] --patch <pathspec>" to assume push
The support for assuming "push" when "-p" is given introduced in
9e140909f61 (stash: allow pathspecs in the no verb form, 2017-02-28) is
very narrow, neither "git stash -m <message> -p <pathspec>" nor "git
stash --patch <pathspec>" imply "push" and die instead. Relax this by
passing PARSE_OPT_STOP_AT_NON_OPTION when push is being assumed and then
setting "force_assume" if "--patch" was present. This means "git stash
<pathspec> -p" still dies so that it does not assume the user meant
"push" if they mistype a subcommand name but "git stash -m <message> -p
<pathspec>" will now succeed. The test added in the last commit is
adjusted to check that push is still assumed when "--patch" comes after
other options on the command-line.
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.c')
0 files changed, 0 insertions, 0 deletions
