summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 83933c9)
raw | patch | inline | side by side (parent: 83933c9)
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Sat, 1 Oct 2011 15:43:52 +0000 (17:43 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 3 Oct 2011 18:02:56 +0000 (11:02 -0700) |
This function is a combination of the static get_reference and
add_pending_object. It can be used to easily queue objects by hash.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
add_pending_object. It can be used to easily queue objects by hash.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
revision.c | patch | blob | history | |
revision.h | patch | blob | history |
diff --git a/revision.c b/revision.c
index c46cfaa3e4d2f06fd67ccd71c7ba47891796fd60..2e8aa3393a74faea41878914bd66636162d6d10c 100644 (file)
--- a/revision.c
+++ b/revision.c
@@ -185,6 +185,13 @@ static struct object *get_reference(struct rev_info *revs, const char *name, con
return object;
}
+void add_pending_sha1(struct rev_info *revs, const char *name,
+ const unsigned char *sha1, unsigned int flags)
+{
+ struct object *object = get_reference(revs, name, sha1, flags);
+ add_pending_object(revs, object, name);
+}
+
static struct commit *handle_commit(struct rev_info *revs, struct object *object, const char *name)
{
unsigned long flags = object->flags;
static int handle_one_ref(const char *path, const unsigned char *sha1, int flag, void *cb_data)
{
struct all_refs_cb *cb = cb_data;
- struct object *object = get_reference(cb->all_revs, path, sha1,
- cb->all_flags);
- add_pending_object(cb->all_revs, object, path);
+ add_pending_sha1(cb->all_revs, path, sha1, cb->all_flags);
return 0;
}
diff --git a/revision.h b/revision.h
index 3d64adad18e2c889b7a7b7367f99c239f958dc70..45412656ddcbbf2904b8e1a86e32e456899a9718 100644 (file)
--- a/revision.h
+++ b/revision.h
const char *name);
extern void add_pending_object(struct rev_info *revs, struct object *obj, const char *name);
+extern void add_pending_sha1(struct rev_info *revs, const char *name, const unsigned char *sha1, unsigned int flags);
extern void add_head_to_pending(struct rev_info *);