]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
SCRIPTS: backport: fix the master branch detection
authorWilly Tarreau <w@1wt.eu>
Fri, 7 Feb 2020 07:26:49 +0000 (08:26 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 7 Feb 2020 07:26:49 +0000 (08:26 +0100)
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.

scripts/backport

index 36cdb577346e928417b0d7f1ce0eff1491c78330..0dc102cfdadc97ac746f8b7e04ca49a7a66bfdbc 100755 (executable)
@@ -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.