Skip to content

Commit f300fab

Browse files
trastgitster
authored andcommitted
DWIM 'git stash save -p' for 'git stash -p'
Signed-off-by: Thomas Rast <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 367ea19 commit f300fab

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Documentation/git-stash.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ SYNOPSIS
1414
'git stash' ( pop | apply ) [--index] [-q|--quiet] [<stash>]
1515
'git stash' branch <branchname> [<stash>]
1616
'git stash' [save [--patch] [-k|--[no-]keep-index] [-q|--quiet] [<message>]]
17-
'git stash' [-k|--keep-index]
17+
'git stash' [-p|--patch|-k|--keep-index]
1818
'git stash' clear
1919
'git stash' create
2020

git-stash.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,8 @@ branch)
406406
apply_to_branch "$@"
407407
;;
408408
*)
409-
case $#,"$1" in
410-
0,|1,-k|1,--keep-index)
409+
case $#,"$1","$2" in
410+
0,,|1,-k,|1,--keep-index,|1,-p,|1,--patch,|2,-p,--no-keep-index|2,--patch,--no-keep-index)
411411
save_stash "$@" &&
412412
say '(To restore them type "git stash apply")'
413413
;;

0 commit comments

Comments
 (0)