From ecff5e1a3c312721c0833255925c6ec200e3b7bf Mon Sep 17 00:00:00 2001 From: spacewander Date: Fri, 20 Dec 2019 18:22:06 +0800 Subject: [PATCH] git-coauthor: quote variable in the comparison --- bin/git-coauthor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/git-coauthor b/bin/git-coauthor index 522f2db..c51400e 100755 --- a/bin/git-coauthor +++ b/bin/git-coauthor @@ -9,7 +9,7 @@ test -z "$coauthor" && echo "co-author required." 1>&2 && exit 1 test -z "$email" && echo "co-author email required." 1>&2 && exit 1 old_message="$(git log --format=%B -n1)" -if [[ $old_message == *"Co-authored-by:"* ]]; then +if [[ "$old_message" == *"Co-authored-by:"* ]]; then git commit --amend -m "$old_message Co-authored-by: $coauthor <$email>" else