Skip to content

Commit

Permalink
Allow passing parameters to branch_delete and stash_show (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
sandr01d authored May 31, 2023
1 parent 0bedb80 commit 665e3fd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bin/git-forgit
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,11 @@ _forgit_reset_head() {
# git stash viewer
_forgit_stash_show() {
_forgit_inside_work_tree || return 1
local git_stash_list cmd opts
local git_stash_show git_stash_list cmd opts
git_stash_show="git stash show --color=always --ext-diff"
[[ $# -ne 0 ]] && $git_stash_show "$@" && return
git_stash_list="git stash list $FORGIT_STASH_SHOW_GIT_OPTS"
cmd="echo {} |cut -d: -f1 |xargs -I% git stash show --color=always --ext-diff % |$_forgit_diff_pager"
cmd="echo {} |cut -d: -f1 |xargs -I% $git_stash_show % |$_forgit_diff_pager"
opts="
$FORGIT_FZF_DEFAULT_OPTS
+s +m -0 --tiebreak=index --bind=\"enter:execute($cmd | $_forgit_enter_pager)\"
Expand Down Expand Up @@ -517,6 +519,7 @@ _forgit_branch_delete() {
_forgit_inside_work_tree || return 1
local git_branch preview opts cmd branches
git_branch="git branch $FORGIT_BRANCH_DELETE_GIT_OPTS"
[[ $# -ne 0 ]] && $git_branch -D "$@" && return
preview="git log {1} $_forgit_log_preview_options"

opts="
Expand Down

0 comments on commit 665e3fd

Please sign in to comment.