Code

shortlog: handle multi-line subjects like log --pretty=oneline et. al. do
[git.git] / diff.c
diff --git a/diff.c b/diff.c
index f160c1a35b786c8b1bb4451c254915bffde0fae3..0484601f42a8aeac408d560091d341f571f231dd 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1778,7 +1778,8 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only)
 
                        if (strbuf_readlink(&sb, s->path, s->size))
                                goto err_empty;
-                       s->data = strbuf_detach(&sb, &s->size);
+                       s->size = sb.len;
+                       s->data = strbuf_detach(&sb, NULL);
                        s->should_free = 1;
                        return 0;
                }