summaryrefslogtreecommitdiff
path: root/reachable.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-10-15 22:38:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-10-16 17:10:38 (GMT)
commit718ccc9731c4e98b123436c22c1cccf2beed5e29 (patch)
tree2c04d25cff912cf5124d7c1a2c3b4409614f6a32 /reachable.c
parent5f78a431ab222189b11a9233a5902db61aa32976 (diff)
downloadgit-718ccc9731c4e98b123436c22c1cccf2beed5e29.zip
git-718ccc9731c4e98b123436c22c1cccf2beed5e29.tar.gz
git-718ccc9731c4e98b123436c22c1cccf2beed5e29.tar.bz2
reachable: reuse revision.c "add all reflogs" code
We want to add all reflog entries as tips for finding reachable objects. The revision machinery can already do this (to support "rev-list --reflog"); we can reuse that code. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reachable.c')
-rw-r--r--reachable.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/reachable.c b/reachable.c
index 02bf6c2..4e68cfa 100644
--- a/reachable.c
+++ b/reachable.c
@@ -22,22 +22,6 @@ static void update_progress(struct connectivity_progress *cp)
display_progress(cp->progress, cp->count);
}
-static int add_one_reflog_ent(unsigned char *osha1, unsigned char *nsha1,
- const char *email, unsigned long timestamp, int tz,
- const char *message, void *cb_data)
-{
- struct object *object;
- struct rev_info *revs = (struct rev_info *)cb_data;
-
- object = parse_object(osha1);
- if (object)
- add_pending_object(revs, object, "");
- object = parse_object(nsha1);
- if (object)
- add_pending_object(revs, object, "");
- return 0;
-}
-
static int add_one_ref(const char *path, const unsigned char *sha1, int flag, void *cb_data)
{
struct object *object = parse_object_or_die(sha1, path);
@@ -48,12 +32,6 @@ static int add_one_ref(const char *path, const unsigned char *sha1, int flag, vo
return 0;
}
-static int add_one_reflog(const char *path, const unsigned char *sha1, int flag, void *cb_data)
-{
- for_each_reflog_ent(path, add_one_reflog_ent, cb_data);
- return 0;
-}
-
static void add_one_tree(const unsigned char *sha1, struct rev_info *revs)
{
struct tree *tree = lookup_tree(sha1);
@@ -138,7 +116,7 @@ void mark_reachable_objects(struct rev_info *revs, int mark_reflog,
/* Add all reflog info */
if (mark_reflog)
- for_each_reflog(add_one_reflog, revs);
+ add_reflogs_to_pending(revs, 0);
cp.progress = progress;
cp.count = 0;