Skip to content

Commit 665e3fd

Browse files
authored
Allow passing parameters to branch_delete and stash_show (#312)
1 parent 0bedb80 commit 665e3fd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bin/git-forgit

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,11 @@ _forgit_reset_head() {
212212
# git stash viewer
213213
_forgit_stash_show() {
214214
_forgit_inside_work_tree || return 1
215-
local git_stash_list cmd opts
215+
local git_stash_show git_stash_list cmd opts
216+
git_stash_show="git stash show --color=always --ext-diff"
217+
[[ $# -ne 0 ]] && $git_stash_show "$@" && return
216218
git_stash_list="git stash list $FORGIT_STASH_SHOW_GIT_OPTS"
217-
cmd="echo {} |cut -d: -f1 |xargs -I% git stash show --color=always --ext-diff % |$_forgit_diff_pager"
219+
cmd="echo {} |cut -d: -f1 |xargs -I% $git_stash_show % |$_forgit_diff_pager"
218220
opts="
219221
$FORGIT_FZF_DEFAULT_OPTS
220222
+s +m -0 --tiebreak=index --bind=\"enter:execute($cmd | $_forgit_enter_pager)\"
@@ -517,6 +519,7 @@ _forgit_branch_delete() {
517519
_forgit_inside_work_tree || return 1
518520
local git_branch preview opts cmd branches
519521
git_branch="git branch $FORGIT_BRANCH_DELETE_GIT_OPTS"
522+
[[ $# -ne 0 ]] && $git_branch -D "$@" && return
520523
preview="git log {1} $_forgit_log_preview_options"
521524

522525
opts="

0 commit comments

Comments
 (0)