]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
post-receive.hook: Handle failure to find patch number
authorTom Rini <trini@konsulko.com>
Mon, 19 Dec 2016 21:54:17 +0000 (16:54 -0500)
committerStephen Finucane <stephen@that.guru>
Thu, 4 Jan 2018 11:36:00 +0000 (11:36 +0000)
When pwclient info -h fails to come up with the number for the change in
question it will exit with a non-zero exit code.  This failure will
propagate upwards and exit the script there.  Make our call to
get_patch_id or in true so that our script here will see an empty id and
we continue on with the list.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
(cherry picked from commit 0743dd0af9842c7ded4873892085a3f505062440)

tools/post-receive.hook

index 8098ce825a6e5a68da4e3087796309853ae1ee9b..7f8ae7ee5487ff4167e1b229b878ce01b4a2d2ca 100755 (executable)
@@ -66,7 +66,7 @@ update_patches() {
             echo "E: failed to hash rev $rev." >&2
             continue
         fi
-        id=$(get_patch_id "$hash")
+        id=$(get_patch_id "$hash" || true)
         if [ -z "$id" ]; then
             echo "E: failed to find patch for rev $rev." >&2
             continue