mirror of
https://github.com/wfxr/forgit.git
synced 2026-09-10 07:16:23 -04:00
Only show available cherry picks in preview (#293)
This is a follow-up to #266, which already switched to showing only available commits during cherry-picking. This patch does the same for the branch preview in _forgit_cherry_pick_from_branch.
This commit is contained in:
parent
9bb53dc455
commit
4b8234a9ff
|
|
@ -315,13 +315,17 @@ _forgit_cherry_pick() {
|
|||
|
||||
_forgit_cherry_pick_from_branch() {
|
||||
_forgit_inside_work_tree || return 1
|
||||
local cmd preview opts branch exitval input_branch args
|
||||
local cmd preview opts branch exitval input_branch args base
|
||||
|
||||
base=$(git branch --show-current)
|
||||
[[ -z "$base" ]] && echo "Current commit is not on a branch." && return 1
|
||||
|
||||
args=("$@")
|
||||
if [[ $# -ne 0 ]]; then
|
||||
input_branch=${args[0]}
|
||||
fi
|
||||
cmd="git branch --color=always --all | LC_ALL=C sort -k1.1,1.1 -rs"
|
||||
preview="git log {1} $_forgit_log_preview_options"
|
||||
preview="git log --right-only --color=always --cherry-pick --oneline $base...{1}"
|
||||
opts="
|
||||
$FORGIT_FZF_DEFAULT_OPTS
|
||||
+s +m --tiebreak=index --header-lines=1
|
||||
|
|
|
|||
Loading…
Reference in a new issue