fetch: add test to make sure we stay backwards compatible
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index ea7e5978bce1e91b603bb3beb61dfc391e2f80ef..69f03570adf6cf2c3642aea1fb0dba5011ef966f 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1541,7 +1541,7 @@ static void emit_rewrite_diff(const char *name_a,
 
 struct diff_words_buffer {
        mmfile_t text;
-       long alloc;
+       unsigned long alloc;
        struct diff_words_orig {
                const char *begin, *end;
        } *orig;
@@ -3738,7 +3738,7 @@ static void prep_temp_blob(const char *path, struct diff_tempfile *temp,
                blob = buf.buf;
                size = buf.len;
        }
-       if (write_in_full(temp->tempfile->fd, blob, size) != size ||
+       if (write_in_full(temp->tempfile->fd, blob, size) < 0 ||
            close_tempfile_gently(temp->tempfile))
                die_errno("unable to write temp-file");
        temp->name = get_tempfile_path(temp->tempfile);
@@ -5272,6 +5272,7 @@ static void show_mode_change(struct diff_options *opt, struct diff_filepair *p,
                        strbuf_addch(&sb, ' ');
                        quote_c_style(p->two->path, &sb, NULL, 0);
                }
+               strbuf_addch(&sb, '\n');
                emit_diff_symbol(opt, DIFF_SYMBOL_SUMMARY,
                                 sb.buf, sb.len, 0);
                strbuf_release(&sb);