X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=entry.c;h=fc3a506ecef4ed654f26c11996df109dd135a4ed;hb=db21872395a1a092faa85ef9c1ea53588d8414f0;hp=0625112339deee7418571b5d513f923d6f00092b;hpb=b8de7f764e1a9f6e8dfb587a6145906394fa607d;p=git.git diff --git a/entry.c b/entry.c index 062511233..fc3a506ec 100644 --- a/entry.c +++ b/entry.c @@ -112,6 +112,16 @@ static int write_entry(struct cache_entry *ce, char *path, const struct checkout if (!new) return error("git-checkout-index: unable to read sha1 file of %s (%s)", path, sha1_to_hex(ce->sha1)); + + /* + * Convert from git internal format to working tree format + */ + buf = convert_to_working_tree(ce->name, new, &size); + if (buf) { + free(new); + new = buf; + } + if (to_tempfile) { strcpy(path, ".merge_file_XXXXXX"); fd = mkstemp(path); @@ -123,15 +133,6 @@ static int write_entry(struct cache_entry *ce, char *path, const struct checkout path, strerror(errno)); } - /* - * Convert from git internal format to working tree format - */ - buf = convert_to_working_tree(ce->name, new, &size); - if (buf) { - free(new); - new = buf; - } - wrote = write_in_full(fd, new, size); close(fd); free(new);