diff options
| author | Carlos Martín Nieto <carlosmn@github.com> | 2016-03-14 17:45:15 +0100 |
|---|---|---|
| committer | Carlos Martín Nieto <carlosmn@github.com> | 2016-03-14 17:45:15 +0100 |
| commit | 4848dd326a98c5973b82f5a362a52362855a4fc5 (patch) | |
| tree | be3818990dfa00b817de402c5f5b66f6a1e5f57e /script | |
| parent | fa31ee6835873f3228c2206988c284ce705cd04b (diff) | |
| parent | 2615d0d6949c9f52e988ab649f10cf7a80c45186 (diff) | |
| download | libgit2-4848dd326a98c5973b82f5a362a52362855a4fc5.tar.gz | |
Merge pull request #3647 from pks-t/pks/coverity-fixes-round6
Coverity fixes round 6
Diffstat (limited to 'script')
| -rwxr-xr-x | script/coverity.sh | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/script/coverity.sh b/script/coverity.sh index 8c826892f..7fe9eb4c7 100755 --- a/script/coverity.sh +++ b/script/coverity.sh @@ -49,10 +49,24 @@ COVERITY_UNSUPPORTED=1 \ # Upload results tar czf libgit2.tgz cov-int SHA=$(git rev-parse --short HEAD) -curl \ + +HTML="$(curl \ + --silent \ + --write-out "\n%{http_code}" \ --form token="$COVERITY_TOKEN" \ --form email=bs@github.com \ --form file=@libgit2.tgz \ --form version="$SHA" \ --form description="Travis build" \ - https://scan.coverity.com/builds?project=libgit2 + https://scan.coverity.com/builds?project=libgit2)" +# Body is everything up to the last line +BODY="$(echo "$HTML" | head -n-1)" +# Status code is the last line +STATUS_CODE="$(echo "$HTML" | tail -n1)" + +echo "${BODY}" + +if [ "${STATUS_CODE}" != "201" ]; then + echo "Received error code ${STATUS_CODE} from Coverity" + exit 1 +fi |
