Code

Merge branch 'master' into db/fetch-pack
[git.git] / entry.c
diff --git a/entry.c b/entry.c
index 4a8c73bfaee14c84866f1a20b7fcd8421d3812f1..98f5f6d4ecfc0dabae9a920bdf3beadbf20abcaf 100644 (file)
--- a/entry.c
+++ b/entry.c
@@ -120,8 +120,7 @@ static int write_entry(struct cache_entry *ce, char *path, const struct checkout
                strbuf_init(&buf, 0);
                if (convert_to_working_tree(ce->name, new, size, &buf)) {
                        free(new);
-                       new = buf.buf;
-                       size = buf.len;
+                       new = strbuf_detach(&buf, &size);
                }
 
                if (to_tempfile) {