From d18e65dbdf5fb47d284265a385b66916404ee9eb Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Wed, 5 Oct 2016 20:03:45 +0200 Subject: [PATCH] travis: also search unknown submodule commit in branches --- scripts/travis-common.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/travis-common.sh b/scripts/travis-common.sh index 40d18374e..56909b79d 100644 --- a/scripts/travis-common.sh +++ b/scripts/travis-common.sh @@ -30,14 +30,15 @@ on () { git_submodule_update () { git submodule update "$@" && return - # failed, search pull requests for matching commits + # failed, search branch and pull request heads for matching commit git submodule foreach \ ' test "$sha1" = "`git rev-parse HEAD`" || - git ls-remote origin "refs/pull/*/head" | + git ls-remote origin "refs/heads/*" "refs/pull/*/head" | while read hash ref; do if test "$hash" = "$sha1"; then - git config --add remote.origin.fetch "+$ref:$ref"; + git config --add remote.origin.fetch "+$ref:$ref" + break fi done '