diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2015-05-01 14:25:47 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-05-10 11:31:32 -0700 |
commit | e4f2431c7c4f3a98cd5a73eab9f000ea7242ca66 (patch) | |
tree | 09314c6476e5768c25272422f54c95ae8ae2d7e8 | |
parent | 5c3f5c70e2d0466eb9a45ee7387dc574edccf87e (diff) | |
download | git-e4f2431c7c4f3a98cd5a73eab9f000ea7242ca66.tar.gz |
struct nonmatching_ref_data: store a refname instead of a ref_entry
Now that we don't need a ref_entry to pass to
report_refname_conflict(), it is sufficient to store the refname of
the conflicting reference.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
-rw-r--r-- | refs.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -849,7 +849,7 @@ static void prime_ref_dir(struct ref_dir *dir) struct nonmatching_ref_data { const struct string_list *skip; - struct ref_entry *found; + const char *conflicting_refname; }; static int nonmatching_ref_fn(struct ref_entry *entry, void *vdata) @@ -859,7 +859,7 @@ static int nonmatching_ref_fn(struct ref_entry *entry, void *vdata) if (data->skip && string_list_has_string(data->skip, entry->name)) return 0; - data->found = entry; + data->conflicting_refname = entry->name; return 1; } @@ -951,7 +951,8 @@ static int is_refname_available(const char *refname, if (!do_for_each_entry_in_dir(dir, 0, nonmatching_ref_fn, &data)) return 1; - error("'%s' exists; cannot create '%s'", data.found->name, refname); + error("'%s' exists; cannot create '%s'", + data.conflicting_refname, refname); return 0; } |