scripts: check fixed commit branch
[dpdk.git] / scripts / check-git-log.sh
index 9a0d068..7d2c7ee 100755 (executable)
@@ -140,7 +140,11 @@ IFS='
 fixtags=$(echo "$tags" | grep '^Fixes: ')
 bad=$(for fixtag in $fixtags ; do
        hash=$(echo "$fixtag" | sed 's,^Fixes: \([0-9a-f]*\).*,\1,')
-       good="Fixes: $hash "$(git log --format='("%s")' -1 $hash 2>&-)
+       if git branch --contains $hash | grep -q '^\*' ; then
+               good="Fixes: $hash "$(git log --format='("%s")' -1 $hash 2>&-)
+       else
+               good="reference not in current branch"
+       fi
        printf "$fixtag" | grep -v "^$good$"
 done | sed 's,^,\t,')
 [ -z "$bad" ] || printf "Wrong 'Fixes' reference:\n$bad\n"