diff options
author | Alex Riesen <raa.lkml@gmail.com> | 2007-04-19 02:05:03 +0200 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-04-20 23:24:34 -0700 |
commit | ac78e548049f4e86b38368d2c4b4dbb546c64ac6 (patch) | |
tree | 37994b847883946eefb34b50d53549335525d428 /sha1_file.c | |
parent | 88e7fdf2cb436e068434241b0519577293055c19 (diff) | |
download | git-ac78e548049f4e86b38368d2c4b4dbb546c64ac6.tar.gz |
Simplify calling of CR/LF conversion routines
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'sha1_file.c')
-rw-r--r-- | sha1_file.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sha1_file.c b/sha1_file.c index 4304fe9bbc..1978d5f14e 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -2277,10 +2277,9 @@ int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object, */ if ((type == OBJ_BLOB) && S_ISREG(st->st_mode)) { unsigned long nsize = size; - char *nbuf = buf; - if (convert_to_git(path, &nbuf, &nsize)) { - if (size) - munmap(buf, size); + char *nbuf = convert_to_git(path, buf, &nsize); + if (nbuf) { + munmap(buf, size); size = nsize; buf = nbuf; re_allocated = 1; |