Merge branch 'jc/maint-apply-match-beginning'
[gitweb.git] / builtin-tag.c
index 9a59caf70d74cae9b7eae858402233ad6f7c3984..8dd959fe1c74507023f8e82c7f4682c1588ebac6 100644 (file)
@@ -230,19 +230,17 @@ static int do_sign(struct strbuf *buffer)
 
        if (write_in_full(gpg.in, buffer->buf, buffer->len) != buffer->len) {
                close(gpg.in);
+               close(gpg.out);
                finish_command(&gpg);
                return error("gpg did not accept the tag data");
        }
        close(gpg.in);
-       gpg.close_in = 0;
        len = strbuf_read(buffer, gpg.out, 1024);
+       close(gpg.out);
 
        if (finish_command(&gpg) || !len || len < 0)
                return error("gpg failed to sign the tag");
 
-       if (len < 0)
-               return error("could not read the entire signature from gpg.");
-
        return 0;
 }