prefer "!=" when checking read_in_full() result
[gitweb.git] / commit.c
index 17a93d1e64fd7122ce0d3471a85388cd445ab6b2..906298052d485867599a98af1cf49e4728028b50 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -1570,10 +1570,13 @@ int commit_tree_extended(const char *msg, size_t msg_len,
        if (encoding_is_utf8 && !verify_utf8(&buffer))
                fprintf(stderr, _(commit_utf8_warn));
 
-       if (sign_commit && do_sign_commit(&buffer, sign_commit))
-               return -1;
+       if (sign_commit && do_sign_commit(&buffer, sign_commit)) {
+               result = -1;
+               goto out;
+       }
 
        result = write_sha1_file(buffer.buf, buffer.len, commit_type, ret);
+out:
        strbuf_release(&buffer);
        return result;
 }