Merge branch 'jk/write-in-full-fix'
[gitweb.git] / refs.c
diff --git a/refs.c b/refs.c
index c30f4c36be57d9304464bf96e54e9b38742ffdaf..e8b67ddce80c83f8ec0dbfb3adc6d6c10b2f4b2d 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -609,7 +609,7 @@ static int write_pseudoref(const char *pseudoref, const unsigned char *sha1,
                }
        }
 
-       if (write_in_full(fd, buf.buf, buf.len) != buf.len) {
+       if (write_in_full(fd, buf.buf, buf.len) < 0) {
                strbuf_addf(err, "could not write to '%s'", filename);
                rollback_lock_file(&lock);
                goto done;