diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-25 18:27:14 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-25 18:27:14 -0700 |
commit | 3ff1fbbb9446e03050047a67247151887ee59e70 (patch) | |
tree | 82360cb0096cfa15327f914964de694d335ec7a6 /commit.c | |
parent | e871b649a3f4ede26eb98c7d46df7acdc7ecbe81 (diff) | |
download | git-3ff1fbbb9446e03050047a67247151887ee59e70.tar.gz git-3ff1fbbb9446e03050047a67247151887ee59e70.tar.xz |
commit: save the commit buffer off when parsing a commit
object.
A fair number of the users potentially want to look at the
commit objects more closely, and if you worry about memory
leaking in certain applications, you can always do a
free(commit->buffer);
commit->buffer = NULL;
by hand after parsing them.
Diffstat (limited to 'commit.c')
-rw-r--r-- | commit.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -103,6 +103,10 @@ int parse_commit(struct commit *item) sha1_to_hex(item->object.sha1)); } ret = parse_commit_buffer(item, buffer, size); + if (!ret) { + item->buffer = buffer; + return 0; + } free(buffer); return ret; } |