author | Lars Hjemli <hjemli@gmail.com> | 2007-02-04 21:55:19 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-02-04 21:55:19 (UTC) |
commit | 8fb2f056961e577a039ae185d89ab8e2d2840b9e (patch) (side-by-side diff) | |
tree | a009aca3c52dd134faa48181daede79bd930f9a4 /git.h | |
parent | ce1c7336e5b3e3ebe8f8c9029c405aedec98c208 (diff) | |
download | cgit-8fb2f056961e577a039ae185d89ab8e2d2840b9e.zip cgit-8fb2f056961e577a039ae185d89ab8e2d2840b9e.tar.gz cgit-8fb2f056961e577a039ae185d89ab8e2d2840b9e.tar.bz2 |
Add support for lightweight tags
There is nothing bad about a tag that has no tag-object, but the old code
didn't handle such tags correctly. Fix it.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | git.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -233,96 +233,100 @@ struct grep_opt { }; extern void compile_grep_patterns(struct grep_opt *opt); extern void free_grep_patterns(struct grep_opt *opt); /* * from git:object.h */ extern const char *type_names[9]; struct object_list { struct object *item; struct object_list *next; }; struct object_refs { unsigned count; struct object *base; struct object *ref[FLEX_ARRAY]; /* more */ }; struct object_array { unsigned int nr; unsigned int alloc; struct object_array_entry { struct object *item; const char *name; } *objects; }; #define TYPE_BITS 3 #define FLAG_BITS 27 /* * The object type is stored in 3 bits. */ struct object { unsigned parsed : 1; unsigned used : 1; unsigned type : TYPE_BITS; unsigned flags : FLAG_BITS; unsigned char sha1[20]; }; +/** Returns the object, having parsed it to find out what it is. **/ +struct object *parse_object(const unsigned char *sha1); + + /* * from git:tree.h */ struct tree { struct object object; void *buffer; unsigned long size; }; struct tree *lookup_tree(const unsigned char *sha1); int parse_tree_buffer(struct tree *item, void *buffer, unsigned long size); int parse_tree(struct tree *tree); struct tree *parse_tree_indirect(const unsigned char *sha1); typedef int (*read_tree_fn_t)(const unsigned char *, const char *, int, const char *, unsigned int, int); extern int read_tree_recursive(struct tree *tree, const char *base, int baselen, int stage, const char **match, read_tree_fn_t fn); extern int read_tree(struct tree *tree, int stage, const char **paths); /* from git:commit.h */ struct commit_list { struct commit *item; struct commit_list *next; }; struct commit { struct object object; void *util; unsigned long date; struct commit_list *parents; struct tree *tree; char *buffer; }; struct commit *lookup_commit(const unsigned char *sha1); struct commit *lookup_commit_reference(const unsigned char *sha1); struct commit *lookup_commit_reference_gently(const unsigned char *sha1, int quiet); |