aboutsummaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorAlex Riesen <raa.lkml@gmail.com>2007-04-19 02:05:03 +0200
committerJunio C Hamano <junkio@cox.net>2007-04-20 23:24:34 -0700
commitac78e548049f4e86b38368d2c4b4dbb546c64ac6 (patch)
tree37994b847883946eefb34b50d53549335525d428 /sha1_file.c
parent88e7fdf2cb436e068434241b0519577293055c19 (diff)
downloadgit-ac78e548049f4e86b38368d2c4b4dbb546c64ac6.tar.gz
git-ac78e548049f4e86b38368d2c4b4dbb546c64ac6.tar.xz
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.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 4304fe9bb..1978d5f14 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;