aboutsummaryrefslogtreecommitdiff
path: root/object.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-09-10 12:22:35 -0700
committerJunio C Hamano <gitster@pobox.com>2008-09-10 15:00:17 -0700
commit628b06d7d75588bbe37dfb7ecac19d2694884d66 (patch)
tree5e00e36d09459c129c7a667810834a11b50c0244 /object.h
parentb281eea75f0ab68e3c9510323c73b78cd3e62814 (diff)
downloadgit-628b06d7d75588bbe37dfb7ecac19d2694884d66.tar.gz
git-628b06d7d75588bbe37dfb7ecac19d2694884d66.tar.xz
Fix git-diff-tree --stdin
140b378 (Teach git diff-tree --stdin to diff trees, 2008-08-10) broke the more important case of reading series of commits to filter ones that touch given pathspecs. Noticed by Mark Levedahl, running "gitk ec3a4ba" and trying to focus on commits that touch "t/" directory. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object.h')
-rw-r--r--object.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/object.h b/object.h
index 036bd66fe..d962ff11d 100644
--- a/object.h
+++ b/object.h
@@ -41,7 +41,18 @@ extern int type_from_string(const char *str);
extern unsigned int get_max_object_index(void);
extern struct object *get_indexed_object(unsigned int);
-/** Internal only **/
+/*
+ * This can be used to see if we have heard of the object before, but
+ * it can return "yes we have, and here is a half-initialised object"
+ * for an object that we haven't loaded/parsed yet.
+ *
+ * When parsing a commit to create an in-core commit object, its
+ * parents list holds commit objects that represent its parents, but
+ * they are expected to be lazily initialized and do not know what
+ * their trees or parents are yet. When this function returns such a
+ * half-initialised objects, the caller is expected to initialize them
+ * by calling parse_object() on them.
+ */
struct object *lookup_object(const unsigned char *sha1);
extern void *create_object(const unsigned char *sha1, int type, void *obj);