From: D. Ben Knoble Date: Mon, 12 Oct 2026 17:48:28 GMT Subject: [PATCH 2/5] completion: extract common stash listing code Message-ID: <34fd7f793fa21e83d073ee0547d8de150f460fa9.1791827304.git.ben.knoble@gmail.com> In-Reply-To: With no change in behavior, prepare to adjust how stashes are completed by centralizing candidate generation. Signed-off-by: D. Ben Knoble --- contrib/completion/git-completion.bash | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index d60e85479c..697fef5462 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -3593,20 +3593,23 @@ _git_stash () if [ $cword -eq $((__git_cmd_idx+2)) ]; then __git_complete_refs else - __gitcomp_nl "$(__git stash list \ - | sed -n -e 's/:.*//p')" + __git_complete_stashes fi ;; import,*) __git_complete_refs ;; show,*|apply,*|drop,*|pop,*|export,*) - __gitcomp_nl "$(__git stash list \ - | sed -n -e 's/:.*//p')" + __git_complete_stashes ;; esac } +__git_complete_stashes () +{ + __gitcomp_nl "$(__git stash list | sed -n -e 's/:.*//p')" +} + _git_submodule () { __git_has_doubledash && return -- 2.56.0.184.g5a00b4a6e9.dirty