From 24ac1d40d5fb6b215e44a8d4dc926fdbe46ef978 Mon Sep 17 00:00:00 2001 From: sandroid Date: Sun, 25 May 2025 19:24:23 +0200 Subject: [PATCH] Refactor: Do not pass files to fixup and squash Similar to 09f17c9, this removes the option to pass files to the fixup and squash functions. There is no need to do so. --- bin/git-forgit | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/bin/git-forgit b/bin/git-forgit index f2eaba8..d453786 100755 --- a/bin/git-forgit +++ b/bin/git-forgit @@ -759,34 +759,32 @@ _forgit_file_preview() { _forgit_fixup() { _forgit_inside_work_tree || return 1 git diff --cached --quiet && echo 'Nothing to fixup: there are no staged changes.' && return 1 - _forgit_edit_commit --fixup "$FORGIT_FIXUP_FZF_OPTS" "$FORGIT_FIXUP_GIT_OPTS" "$@" + _forgit_edit_commit --fixup "$FORGIT_FIXUP_FZF_OPTS" "$FORGIT_FIXUP_GIT_OPTS" } _forgit_squash() { _forgit_inside_work_tree || return 1 git diff --cached --quiet && echo 'Nothing to squash: there are no staged changes.' && return 1 - _forgit_edit_commit --squash "$FORGIT_SQUASH_FZF_OPTS" "$FORGIT_SQUASH_GIT_OPTS" "$@" + _forgit_edit_commit --squash "$FORGIT_SQUASH_FZF_OPTS" "$FORGIT_SQUASH_GIT_OPTS" } _forgit_edit_commit() { - local action fzf_opts opts graph quoted_files target_commit prev_commit + local action fzf_opts opts graph target_commit prev_commit action=$1 fzf_opts=$2 graph=() [[ $_forgit_log_graph_enable == true ]] && graph=(--graph) git_opts=() _forgit_parse_array git_opts "$3" - shift 3 - quoted_files=$(_forgit_quote_files "$@") opts=" $FORGIT_FZF_DEFAULT_OPTS +s +m --tiebreak=index --bind=\"ctrl-y:execute-silent($FORGIT yank_sha {})\" - --preview=\"$FORGIT file_preview {} $quoted_files\" + --preview=\"$FORGIT file_preview {}\" $fzf_opts " target_commit=$( - git log "${graph[@]}" --color=always --format="$_forgit_log_format" "$@" | + git log "${graph[@]}" --color=always --format="$_forgit_log_format" | _forgit_emojify | FZF_DEFAULT_OPTS="$opts" fzf | _forgit_extract_sha)