From: Willy Tarreau Date: Fri, 7 Feb 2020 07:26:49 +0000 (+0100) Subject: SCRIPTS: backport: fix the master branch detection X-Git-Tag: v2.2-dev3~101 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f9beea52da07687724374214c38932f6424de70d;p=thirdparty%2Fhaproxy.git SCRIPTS: backport: fix the master branch detection The condition was inverted. When the branch was the master, it was harmless because it caused an extra "checkout master", but when it was not the master, the commit could be applied to the wrong branch and it could even possibly not match the name to stop on. --- diff --git a/scripts/backport b/scripts/backport index 36cdb57734..0dc102cfda 100755 --- a/scripts/backport +++ b/scripts/backport @@ -67,7 +67,7 @@ check_clean() { # verifies that HEAD is the master check_master() { - test "$(git rev-parse --verify -q HEAD 2>&1)" != "$(git rev-parse --verify -q master 2>&1)" + test "$(git rev-parse --verify -q HEAD 2>&1)" = "$(git rev-parse --verify -q master 2>&1)" } # tries to switch to the master branch, only if the current one is clean. Dies on failure.