Skip to content

keep track of unresolved value of symbolic-ref in ref iterators #1712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bisect.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ void find_bisection(struct commit_list **commit_list, int *reaches,
clear_commit_weight(&commit_weight);
}

static int register_ref(const char *refname, const struct object_id *oid,
static int register_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid,
int flags UNUSED, void *cb_data UNUSED)
{
struct strbuf good_prefix = STRBUF_INIT;
Expand Down Expand Up @@ -1170,6 +1170,7 @@ int estimate_bisect_steps(int all)
}

static int mark_for_removal(const char *refname,
const char *referent UNUSED,
const struct object_id *oid UNUSED,
int flag UNUSED, void *cb_data)
{
Expand Down
4 changes: 3 additions & 1 deletion builtin/bisect.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ static int check_and_set_terms(struct bisect_terms *terms, const char *cmd)
}

static int inc_nr(const char *refname UNUSED,
const char *referent UNUSED,
const struct object_id *oid UNUSED,
int flag UNUSED, void *cb_data)
{
Expand Down Expand Up @@ -545,7 +546,7 @@ static int bisect_append_log_quoted(const char **argv)
return res;
}

static int add_bisect_ref(const char *refname, const struct object_id *oid,
static int add_bisect_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid,
int flags UNUSED, void *cb)
{
struct add_bisect_ref_data *data = cb;
Expand Down Expand Up @@ -1162,6 +1163,7 @@ static int bisect_visualize(struct bisect_terms *terms, int argc,
}

static int get_first_good(const char *refname UNUSED,
const char *referent UNUSED,
const struct object_id *oid,
int flag UNUSED, void *cb_data)
{
Expand Down
2 changes: 1 addition & 1 deletion builtin/checkout.c
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
report_tracking(new_branch_info);
}

static int add_pending_uninteresting_ref(const char *refname,
static int add_pending_uninteresting_ref(const char *refname, const char *referent UNUSED,
const struct object_id *oid,
int flags UNUSED, void *cb_data)
{
Expand Down
2 changes: 1 addition & 1 deletion builtin/describe.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static void add_to_known_names(const char *path,
}
}

static int get_name(const char *path, const struct object_id *oid,
static int get_name(const char *path, const char *referent UNUSED, const struct object_id *oid,
int flag UNUSED, void *cb_data UNUSED)
{
int is_tag = 0;
Expand Down
3 changes: 2 additions & 1 deletion builtin/fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static struct refname_hash_entry *refname_hash_add(struct hashmap *map,
return ent;
}

static int add_one_refname(const char *refname,
static int add_one_refname(const char *refname, const char *referent UNUSED,
const struct object_id *oid,
int flag UNUSED, void *cbdata)
{
Expand Down Expand Up @@ -1464,6 +1464,7 @@ static void set_option(struct transport *transport, const char *name, const char


static int add_oid(const char *refname UNUSED,
const char *referent UNUSED,
const struct object_id *oid,
int flags UNUSED, void *cb_data)
{
Expand Down
4 changes: 2 additions & 2 deletions builtin/fsck.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ static int fsck_handle_reflog(const char *logname, void *cb_data)
return 0;
}

static int fsck_handle_ref(const char *refname, const struct object_id *oid,
static int fsck_handle_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid,
int flag UNUSED, void *cb_data UNUSED)
{
struct object *obj;
Expand Down Expand Up @@ -576,7 +576,7 @@ static void get_default_heads(void)
strbuf_worktree_ref(wt, &ref, "HEAD");
fsck_head_link(ref.buf, &head_points_at, &head_oid);
if (head_points_at && !is_null_oid(&head_oid))
fsck_handle_ref(ref.buf, &head_oid, 0, NULL);
fsck_handle_ref(ref.buf, NULL, &head_oid, 0, NULL);
strbuf_release(&ref);

if (include_reflogs)
Expand Down
1 change: 1 addition & 0 deletions builtin/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,7 @@ struct cg_auto_data {
};

static int dfs_on_ref(const char *refname UNUSED,
const char *referent UNUSED,
const struct object_id *oid,
int flags UNUSED,
void *cb_data)
Expand Down
2 changes: 1 addition & 1 deletion builtin/name-rev.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ static int cmp_by_tag_and_age(const void *a_, const void *b_)
return a->taggerdate != b->taggerdate;
}

static int name_ref(const char *path, const struct object_id *oid,
static int name_ref(const char *path, const char *referent UNUSED, const struct object_id *oid,
int flags UNUSED, void *cb_data)
{
struct object *o = parse_object(the_repository, oid);
Expand Down
5 changes: 3 additions & 2 deletions builtin/pack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ static enum write_one_status write_one(struct hashfile *f,
return WRITE_ONE_WRITTEN;
}

static int mark_tagged(const char *path UNUSED, const struct object_id *oid,
static int mark_tagged(const char *path UNUSED, const char *referent UNUSED, const struct object_id *oid,
int flag UNUSED, void *cb_data UNUSED)
{
struct object_id peeled;
Expand Down Expand Up @@ -3129,7 +3129,7 @@ static void add_tag_chain(const struct object_id *oid)
}
}

static int add_ref_tag(const char *tag UNUSED, const struct object_id *oid,
static int add_ref_tag(const char *tag UNUSED, const char *referent UNUSED, const struct object_id *oid,
int flag UNUSED, void *cb_data UNUSED)
{
struct object_id peeled;
Expand Down Expand Up @@ -4076,6 +4076,7 @@ static void record_recent_commit(struct commit *commit, void *data UNUSED)
}

static int mark_bitmap_preferred_tip(const char *refname,
const char *referent UNUSED,
const struct object_id *oid,
int flags UNUSED,
void *data UNUSED)
Expand Down
2 changes: 1 addition & 1 deletion builtin/receive-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ static void show_ref(const char *path, const struct object_id *oid)
}
}

static int show_ref_cb(const char *path_full, const struct object_id *oid,
static int show_ref_cb(const char *path_full, const char *referent UNUSED, const struct object_id *oid,
int flag UNUSED, void *data)
{
struct oidset *seen = data;
Expand Down
4 changes: 3 additions & 1 deletion builtin/remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ struct branches_for_remote {
};

static int add_branch_for_removal(const char *refname,
const char *referent UNUSED,
const struct object_id *oid UNUSED,
int flags UNUSED, void *cb_data)
{
Expand Down Expand Up @@ -585,7 +586,7 @@ struct rename_info {
uint32_t symrefs_nr;
};

static int read_remote_branches(const char *refname,
static int read_remote_branches(const char *refname, const char *referent UNUSED,
const struct object_id *oid UNUSED,
int flags UNUSED, void *cb_data)
{
Expand Down Expand Up @@ -971,6 +972,7 @@ static void free_remote_ref_states(struct ref_states *states)
}

static int append_ref_to_tracked_list(const char *refname,
const char *referent UNUSED,
const struct object_id *oid UNUSED,
int flags, void *cb_data)
{
Expand Down
1 change: 1 addition & 0 deletions builtin/repack.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ struct midx_snapshot_ref_data {
};

static int midx_snapshot_ref_one(const char *refname UNUSED,
const char *referent UNUSED,
const struct object_id *oid,
int flag UNUSED, void *_data)
{
Expand Down
1 change: 1 addition & 0 deletions builtin/replace.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ struct show_data {
};

static int show_reference(const char *refname,
const char *referent UNUSED,
const struct object_id *oid,
int flag UNUSED, void *cb_data)
{
Expand Down
4 changes: 2 additions & 2 deletions builtin/rev-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ static int show_default(void)
return 0;
}

static int show_reference(const char *refname, const struct object_id *oid,
static int show_reference(const char *refname, const char *referent UNUSED, const struct object_id *oid,
int flag UNUSED, void *cb_data UNUSED)
{
if (ref_excluded(&ref_excludes, refname))
Expand All @@ -220,7 +220,7 @@ static int show_reference(const char *refname, const struct object_id *oid,
return 0;
}

static int anti_reference(const char *refname, const struct object_id *oid,
static int anti_reference(const char *refname, const char *referent UNUSED, const struct object_id *oid,
int flag UNUSED, void *cb_data UNUSED)
{
show_rev(REVERSED, oid, refname);
Expand Down
8 changes: 4 additions & 4 deletions builtin/show-branch.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ static int append_ref(const char *refname, const struct object_id *oid,
return 0;
}

static int append_head_ref(const char *refname, const struct object_id *oid,
static int append_head_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid,
int flag UNUSED, void *cb_data UNUSED)
{
struct object_id tmp;
Expand All @@ -425,7 +425,7 @@ static int append_head_ref(const char *refname, const struct object_id *oid,
return append_ref(refname + ofs, oid, 0);
}

static int append_remote_ref(const char *refname, const struct object_id *oid,
static int append_remote_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid,
int flag UNUSED, void *cb_data UNUSED)
{
struct object_id tmp;
Expand All @@ -451,7 +451,7 @@ static int append_tag_ref(const char *refname, const struct object_id *oid,
static const char *match_ref_pattern = NULL;
static int match_ref_slash = 0;

static int append_matching_ref(const char *refname, const struct object_id *oid,
static int append_matching_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid,
int flag, void *cb_data)
{
/* we want to allow pattern hold/<asterisk> to show all
Expand All @@ -468,7 +468,7 @@ static int append_matching_ref(const char *refname, const struct object_id *oid,
if (wildmatch(match_ref_pattern, tail, 0))
return 0;
if (starts_with(refname, "refs/heads/"))
return append_head_ref(refname, oid, flag, cb_data);
return append_head_ref(refname, NULL, oid, flag, cb_data);
if (starts_with(refname, "refs/tags/"))
return append_tag_ref(refname, oid, flag, cb_data);
return append_ref(refname, oid, 0);
Expand Down
3 changes: 2 additions & 1 deletion builtin/show-ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct show_ref_data {
int show_head;
};

static int show_ref(const char *refname, const struct object_id *oid,
static int show_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid,
int flag UNUSED, void *cbdata)
{
struct show_ref_data *data = cbdata;
Expand Down Expand Up @@ -97,6 +97,7 @@ static int show_ref(const char *refname, const struct object_id *oid,
}

static int add_existing(const char *refname,
const char *referent UNUSED,
const struct object_id *oid UNUSED,
int flag UNUSED, void *cbdata)
{
Expand Down
1 change: 1 addition & 0 deletions builtin/submodule--helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ static void print_status(unsigned int flags, char state, const char *path,
}

static int handle_submodule_head_ref(const char *refname UNUSED,
const char *referent UNUSED,
const struct object_id *oid,
int flags UNUSED,
void *cb_data)
Expand Down
1 change: 1 addition & 0 deletions builtin/worktree.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ static void print_preparing_worktree_line(int detach,
* Returns 0 on failure and non-zero on success.
*/
static int first_valid_ref(const char *refname UNUSED,
const char *referent UNUSED,
const struct object_id *oid UNUSED,
int flags UNUSED,
void *cb_data UNUSED)
Expand Down
1 change: 1 addition & 0 deletions commit-graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -1847,6 +1847,7 @@ struct refs_cb_data {
};

static int add_ref_to_set(const char *refname UNUSED,
const char *referent UNUSED,
const struct object_id *oid,
int flags UNUSED, void *cb_data)
{
Expand Down
2 changes: 1 addition & 1 deletion delta-islands.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ static void add_ref_to_island(kh_str_t *remote_islands, const char *island_name,
rl->hash += sha_core;
}

static int find_island_for_ref(const char *refname, const struct object_id *oid,
static int find_island_for_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid,
int flags UNUSED, void *cb)
{
struct island_load_data *ild = cb;
Expand Down
2 changes: 2 additions & 0 deletions fetch-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ static int rev_list_insert_ref(struct fetch_negotiator *negotiator,
}

static int rev_list_insert_ref_oid(const char *refname UNUSED,
const char *referent UNUSED,
const struct object_id *oid,
int flag UNUSED,
void *cb_data)
Expand Down Expand Up @@ -610,6 +611,7 @@ static int mark_complete(const struct object_id *oid)
}

static int mark_complete_oid(const char *refname UNUSED,
const char *referent UNUSED,
const struct object_id *oid,
int flag UNUSED,
void *cb_data UNUSED)
Expand Down
2 changes: 1 addition & 1 deletion help.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ struct similar_ref_cb {
struct string_list *similar_refs;
};

static int append_similar_ref(const char *refname,
static int append_similar_ref(const char *refname, const char *referent UNUSED,
const struct object_id *oid UNUSED,
int flags UNUSED, void *cb_data)
{
Expand Down
4 changes: 2 additions & 2 deletions http-backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ static void run_service(const char **argv, int buffer_input)
exit(1);
}

static int show_text_ref(const char *name, const struct object_id *oid,
static int show_text_ref(const char *name, const char *referent UNUSED, const struct object_id *oid,
int flag UNUSED, void *cb_data)
{
const char *name_nons = strip_namespace(name);
Expand Down Expand Up @@ -568,7 +568,7 @@ static void get_info_refs(struct strbuf *hdr, char *arg UNUSED)
strbuf_release(&buf);
}

static int show_head_ref(const char *refname, const struct object_id *oid,
static int show_head_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid,
int flag, void *cb_data)
{
struct strbuf *buf = cb_data;
Expand Down
2 changes: 1 addition & 1 deletion log-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static int ref_filter_match(const char *refname,
return 1;
}

static int add_ref_decoration(const char *refname, const struct object_id *oid,
static int add_ref_decoration(const char *refname, const char *referent UNUSED, const struct object_id *oid,
int flags UNUSED,
void *cb_data)
{
Expand Down
4 changes: 2 additions & 2 deletions ls-refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct ls_refs_data {
unsigned unborn : 1;
};

static int send_ref(const char *refname, const struct object_id *oid,
static int send_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid,
int flag, void *cb_data)
{
struct ls_refs_data *data = cb_data;
Expand Down Expand Up @@ -135,7 +135,7 @@ static void send_possibly_unborn_head(struct ls_refs_data *data)
oid_is_null = is_null_oid(&oid);
if (!oid_is_null ||
(data->unborn && data->symrefs && (flag & REF_ISSYMREF)))
send_ref(namespaced.buf, oid_is_null ? NULL : &oid, flag, data);
send_ref(namespaced.buf, NULL, oid_is_null ? NULL : &oid, flag, data);
strbuf_release(&namespaced);
}

Expand Down
2 changes: 1 addition & 1 deletion midx-write.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ static void prepare_midx_packing_data(struct packing_data *pdata,
trace2_region_leave("midx", "prepare_midx_packing_data", the_repository);
}

static int add_ref_to_pending(const char *refname,
static int add_ref_to_pending(const char *refname, const char *referent UNUSED,
const struct object_id *oid,
int flag, void *cb_data)
{
Expand Down
2 changes: 1 addition & 1 deletion negotiator/default.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static void rev_list_push(struct negotiation_state *ns,
}
}

static int clear_marks(const char *refname, const struct object_id *oid,
static int clear_marks(const char *refname, const char *referent UNUSED, const struct object_id *oid,
int flag UNUSED,
void *cb_data UNUSED)
{
Expand Down
2 changes: 1 addition & 1 deletion negotiator/skipping.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static struct entry *rev_list_push(struct data *data, struct commit *commit, int
return entry;
}

static int clear_marks(const char *refname, const struct object_id *oid,
static int clear_marks(const char *refname, const char *referent UNUSED, const struct object_id *oid,
int flag UNUSED,
void *cb_data UNUSED)
{
Expand Down
2 changes: 1 addition & 1 deletion notes.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ int combine_notes_cat_sort_uniq(struct object_id *cur_oid,
return ret;
}

static int string_list_add_one_ref(const char *refname,
static int string_list_add_one_ref(const char *refname, const char *referent UNUSED,
const struct object_id *oid UNUSED,
int flag UNUSED, void *cb)
{
Expand Down
Loading
Loading