From f4e313d3f2247c960737e78162ec23d6d75b3478 Mon Sep 17 00:00:00 2001 From: spacewander Date: Tue, 5 Nov 2019 10:30:37 +0800 Subject: [PATCH] git-squash: clean up shellcheck warnings --- bin/git-squash | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/git-squash b/bin/git-squash index b6f412e..541bbf7 100755 --- a/bin/git-squash +++ b/bin/git-squash @@ -31,7 +31,8 @@ is_commit_reference() { } is_on_current_branch() { - local commit_sha=`git rev-parse "$src"` + local commit_sha + commit_sha=$(git rev-parse "$src") git rev-list HEAD | grep -q -- "$commit_sha" } @@ -70,9 +71,9 @@ squash_current_branch() { commit_if_msg_provided } -if `is_branch`; then +if is_branch; then squash_branch -elif `is_commit_reference` && `is_on_current_branch`; then +elif is_commit_reference && is_on_current_branch; then squash_current_branch else echo "Source branch or commit reference required." 1>&2 && exit 1