Skip to content

Commit e7f86cb

Browse files
committed
Merge branch 'jc/refs-symref-referent'
The refs API has been taught to give symref target information to the users of ref iterators, allowing for-each-ref and friends to avoid an extra ref_resolve_* API call per a symbolic ref. * jc/refs-symref-referent: ref-filter: populate symref from iterator refs: add referent to each_ref_fn refs: keep track of unresolved reference value in iterators
2 parents 88457a6 + a30ce14 commit e7f86cb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+117
-62
lines changed

bisect.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ void find_bisection(struct commit_list **commit_list, int *reaches,
448448
clear_commit_weight(&commit_weight);
449449
}
450450

451-
static int register_ref(const char *refname, const struct object_id *oid,
451+
static int register_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid,
452452
int flags UNUSED, void *cb_data UNUSED)
453453
{
454454
struct strbuf good_prefix = STRBUF_INIT;
@@ -1170,6 +1170,7 @@ int estimate_bisect_steps(int all)
11701170
}
11711171

11721172
static int mark_for_removal(const char *refname,
1173+
const char *referent UNUSED,
11731174
const struct object_id *oid UNUSED,
11741175
int flag UNUSED, void *cb_data)
11751176
{

builtin/bisect.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ static int check_and_set_terms(struct bisect_terms *terms, const char *cmd)
356356
}
357357

358358
static int inc_nr(const char *refname UNUSED,
359+
const char *referent UNUSED,
359360
const struct object_id *oid UNUSED,
360361
int flag UNUSED, void *cb_data)
361362
{
@@ -545,7 +546,7 @@ static int bisect_append_log_quoted(const char **argv)
545546
return res;
546547
}
547548

548-
static int add_bisect_ref(const char *refname, const struct object_id *oid,
549+
static int add_bisect_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid,
549550
int flags UNUSED, void *cb)
550551
{
551552
struct add_bisect_ref_data *data = cb;
@@ -1162,6 +1163,7 @@ static int bisect_visualize(struct bisect_terms *terms, int argc,
11621163
}
11631164

11641165
static int get_first_good(const char *refname UNUSED,
1166+
const char *referent UNUSED,
11651167
const struct object_id *oid,
11661168
int flag UNUSED, void *cb_data)
11671169
{

builtin/checkout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
10451045
report_tracking(new_branch_info);
10461046
}
10471047

1048-
static int add_pending_uninteresting_ref(const char *refname,
1048+
static int add_pending_uninteresting_ref(const char *refname, const char *referent UNUSED,
10491049
const struct object_id *oid,
10501050
int flags UNUSED, void *cb_data)
10511051
{

builtin/describe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ static void add_to_known_names(const char *path,
149149
}
150150
}
151151

152-
static int get_name(const char *path, const struct object_id *oid,
152+
static int get_name(const char *path, const char *referent UNUSED, const struct object_id *oid,
153153
int flag UNUSED, void *cb_data UNUSED)
154154
{
155155
int is_tag = 0;

builtin/fetch.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ static struct refname_hash_entry *refname_hash_add(struct hashmap *map,
286286
return ent;
287287
}
288288

289-
static int add_one_refname(const char *refname,
289+
static int add_one_refname(const char *refname, const char *referent UNUSED,
290290
const struct object_id *oid,
291291
int flag UNUSED, void *cbdata)
292292
{
@@ -1464,6 +1464,7 @@ static void set_option(struct transport *transport, const char *name, const char
14641464

14651465

14661466
static int add_oid(const char *refname UNUSED,
1467+
const char *referent UNUSED,
14671468
const struct object_id *oid,
14681469
int flags UNUSED, void *cb_data)
14691470
{

builtin/fsck.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ static int fsck_handle_reflog(const char *logname, void *cb_data)
521521
return 0;
522522
}
523523

524-
static int fsck_handle_ref(const char *refname, const struct object_id *oid,
524+
static int fsck_handle_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid,
525525
int flag UNUSED, void *cb_data UNUSED)
526526
{
527527
struct object *obj;
@@ -576,7 +576,7 @@ static void get_default_heads(void)
576576
strbuf_worktree_ref(wt, &ref, "HEAD");
577577
fsck_head_link(ref.buf, &head_points_at, &head_oid);
578578
if (head_points_at && !is_null_oid(&head_oid))
579-
fsck_handle_ref(ref.buf, &head_oid, 0, NULL);
579+
fsck_handle_ref(ref.buf, NULL, &head_oid, 0, NULL);
580580
strbuf_release(&ref);
581581

582582
if (include_reflogs)

builtin/gc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,7 @@ struct cg_auto_data {
836836
};
837837

838838
static int dfs_on_ref(const char *refname UNUSED,
839+
const char *referent UNUSED,
839840
const struct object_id *oid,
840841
int flags UNUSED,
841842
void *cb_data)

builtin/name-rev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ static int cmp_by_tag_and_age(const void *a_, const void *b_)
337337
return a->taggerdate != b->taggerdate;
338338
}
339339

340-
static int name_ref(const char *path, const struct object_id *oid,
340+
static int name_ref(const char *path, const char *referent UNUSED, const struct object_id *oid,
341341
int flags UNUSED, void *cb_data)
342342
{
343343
struct object *o = parse_object(the_repository, oid);

builtin/pack-objects.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ static enum write_one_status write_one(struct hashfile *f,
771771
return WRITE_ONE_WRITTEN;
772772
}
773773

774-
static int mark_tagged(const char *path UNUSED, const struct object_id *oid,
774+
static int mark_tagged(const char *path UNUSED, const char *referent UNUSED, const struct object_id *oid,
775775
int flag UNUSED, void *cb_data UNUSED)
776776
{
777777
struct object_id peeled;
@@ -3129,7 +3129,7 @@ static void add_tag_chain(const struct object_id *oid)
31293129
}
31303130
}
31313131

3132-
static int add_ref_tag(const char *tag UNUSED, const struct object_id *oid,
3132+
static int add_ref_tag(const char *tag UNUSED, const char *referent UNUSED, const struct object_id *oid,
31333133
int flag UNUSED, void *cb_data UNUSED)
31343134
{
31353135
struct object_id peeled;
@@ -4076,6 +4076,7 @@ static void record_recent_commit(struct commit *commit, void *data UNUSED)
40764076
}
40774077

40784078
static int mark_bitmap_preferred_tip(const char *refname,
4079+
const char *referent UNUSED,
40794080
const struct object_id *oid,
40804081
int flags UNUSED,
40814082
void *data UNUSED)

builtin/receive-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ static void show_ref(const char *path, const struct object_id *oid)
300300
}
301301
}
302302

303-
static int show_ref_cb(const char *path_full, const struct object_id *oid,
303+
static int show_ref_cb(const char *path_full, const char *referent UNUSED, const struct object_id *oid,
304304
int flag UNUSED, void *data)
305305
{
306306
struct oidset *seen = data;

0 commit comments

Comments
 (0)