summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-04-22 00:38:00 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-04-22 00:38:00 (GMT)
commita2d7c6c62080b542007f9787342aa1e57b95f50c (patch)
tree22348e2f38132cd45dcf74cf0c02475d95dbce5b /sha1_file.c
parentafb5b6a24bd333d298d10acac731f1c127bbb82d (diff)
parent5e635e396020cc08bc21a3e67c20c5294d6d13fd (diff)
downloadgit-a2d7c6c62080b542007f9787342aa1e57b95f50c.zip
git-a2d7c6c62080b542007f9787342aa1e57b95f50c.tar.gz
git-a2d7c6c62080b542007f9787342aa1e57b95f50c.tar.bz2
Merge branch 'jc/attr'
* 'jc/attr': (28 commits) lockfile: record the primary process. convert.c: restructure the attribute checking part. Fix bogus linked-list management for user defined merge drivers. Simplify calling of CR/LF conversion routines Document gitattributes(5) Update 'crlf' attribute semantics. Documentation: support manual section (5) - file formats. Simplify code to find recursive merge driver. Counto-fix in merge-recursive Fix funny types used in attribute value representation Allow low-level driver to specify different behaviour during internal merge. Custom low-level merge driver: change the configuration scheme. Allow the default low-level merge driver to be configured. Custom low-level merge driver support. Add a demonstration/test of customized merge. Allow specifying specialized merge-backend per path. merge-recursive: separate out xdl_merge() interface. Allow more than true/false to attributes. Document git-check-attr Change attribute negation marker from '!' to '-'. ...
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 0c0fcc5..0642664 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2338,10 +2338,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;