diff --git a/bin/git-forgit b/bin/git-forgit index f3bb035..8e4fbe8 100755 --- a/bin/git-forgit +++ b/bin/git-forgit @@ -75,7 +75,6 @@ _forgit_emojify() { } # extract the first git sha occurring in the input and strip trailing newline -_forgit_extract_sha="grep -Eo '[a-f0-9]+' | head -1 | tr -d '[:space:]'" _forgit_extract_sha() { grep -Eo '[a-f0-9]+' | head -1 | tr -d '[:space:]' } @@ -556,7 +555,7 @@ _forgit_rebase() { git log "${graph[@]}" --color=always --format="$_forgit_log_format" "$@" | _forgit_emojify | FZF_DEFAULT_OPTS="$opts" fzf | - eval "$_forgit_extract_sha") + _forgit_extract_sha) if [[ -n "$target_commit" ]]; then prev_commit=$(_forgit_previous_commit "$target_commit") git rebase -i "${_forgit_rebase_git_opts[@]}" "$prev_commit" @@ -590,7 +589,7 @@ _forgit_fixup() { git log "${graph[@]}" --color=always --format="$_forgit_log_format" "$@" | _forgit_emojify | FZF_DEFAULT_OPTS="$opts" fzf | - eval "$_forgit_extract_sha") + _forgit_extract_sha) if [[ -n "$target_commit" ]] && git commit "${_forgit_fixup_git_opts[@]}" --fixup "$target_commit"; then prev_commit=$(_forgit_previous_commit "$target_commit") # rebase will fail if there are unstaged changes so --autostash is needed to temporarily stash them @@ -719,7 +718,7 @@ _forgit_checkout_commit() { [[ $_forgit_log_graph_enable == true ]] && graph=(--graph) commit="$(git log "${graph[@]}" --color=always --format="$_forgit_log_format" | _forgit_emojify | - FZF_DEFAULT_OPTS="$opts" fzf | eval "$_forgit_extract_sha")" + FZF_DEFAULT_OPTS="$opts" fzf | _forgit_extract_sha)" _forgit_git_checkout_commit "$commit" }