summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a6f68d4)
raw | patch | inline | side by side (parent: a6f68d4)
author | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Thu, 26 May 2005 02:26:28 +0000 (19:26 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Thu, 26 May 2005 02:26:28 +0000 (19:26 -0700) |
And teach fsck to free it to save memory.
commit.h | patch | blob | history | |
fsck-cache.c | patch | blob | history | |
object.c | patch | blob | history |
diff --git a/commit.h b/commit.h
index 0bb8779ca740af3b474eae8c5019ef309cc8021c..f7a2cb88bd457d11fd1dcb17f5fb17b0860c72ba 100644 (file)
--- a/commit.h
+++ b/commit.h
unsigned long date;
struct commit_list *parents;
struct tree *tree;
- const char *buffer;
+ char *buffer;
};
extern const char *commit_type;
diff --git a/fsck-cache.c b/fsck-cache.c
index 6ac122b71cf9a5eec298a003032c5724d47f306d..4050c17eb020e0a916b23dbb610965cfcd5c7658 100644 (file)
--- a/fsck-cache.c
+++ b/fsck-cache.c
static int fsck_commit(struct commit *commit)
{
+ free(commit->buffer);
+ commit->buffer = NULL;
if (!commit->tree)
return -1;
if (!commit->parents && show_root)
diff --git a/object.c b/object.c
index d093e17d240cff9e62a62b74ca4b3c86a472f54a..5e72a7878488922cfeeb5dba385d72049253f7c3 100644 (file)
--- a/object.c
+++ b/object.c
} else if (!strcmp(type, "commit")) {
struct commit *commit = lookup_commit(sha1);
parse_commit_buffer(commit, buffer, size);
+ if (!commit->buffer) {
+ commit->buffer = buffer;
+ buffer = NULL;
+ }
obj = &commit->object;
} else if (!strcmp(type, "tag")) {
struct tag *tag = lookup_tag(sha1);