Re: [PATCH v1] travis-ci: fix "skip_branch_tip_with_tag()" string comparison

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



larsxschneider@xxxxxxxxx wrote:

> 09f5e97 ("travis-ci: skip a branch build if equal tag is present",
> 2017-09-17) introduced the "skip_branch_tip_with_tag" function with
> a broken string comparison. Fix it!
>
> Reported-by: SZEDER Gábor <szeder.dev@xxxxxxxxx>
> Signed-off-by: Lars Schneider <larsxschneider@xxxxxxxxx>
> ---

Thanks for the fix.

09f5e97 appears to be for the ls/travis-scriptify branch, which is
already part of "next" (if it weren't, I'd suggest just squashing your
patch into that commit).

> --- a/ci/lib-travisci.sh
> +++ b/ci/lib-travisci.sh
> @@ -14,7 +14,7 @@ skip_branch_tip_with_tag () {
>  	# of a tag.
> 
>  	if TAG=$(git describe --exact-match "$TRAVIS_BRANCH" 2>/dev/null) &&
> -		$TAG != $TRAVIS_BRANCH
> +		[ "$TAG" != "$TRAVIS_BRANCH" ]

Git style is to use 'test' instead of '[' for this.  See
https://public-inbox.org/git/2f3cdc85-f051-c0ae-b9db-fd13cac78aed@xxxxxxxxx/
for more on that subject.

Could you squash in the following?

Thanks,
Jonathan

diff --git i/ci/lib-travisci.sh w/ci/lib-travisci.sh
index c3b46f4a7d..b3ed0a0dda 100755
--- i/ci/lib-travisci.sh
+++ w/ci/lib-travisci.sh
@@ -14,7 +14,7 @@ skip_branch_tip_with_tag () {
 	# of a tag.
 
 	if TAG=$(git describe --exact-match "$TRAVIS_BRANCH" 2>/dev/null) &&
-		[ "$TAG" != "$TRAVIS_BRANCH" ]
+		test "$TAG" != "$TRAVIS_BRANCH"
 	then
 		echo "Tip of $TRAVIS_BRANCH is exactly at $TAG"
 		exit 0



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux