report_refname_conflict(): inline function

It wasn't pulling its weight. And we are about to need code similar to this where no ref_entry is available and with more diverse error messages. Rather than try to generalize the function, just inline it. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>

Michael Haggerty committed May 11, 2015 at 17:25 UTC 385e8af5a2d1056b75428eea810bce65d2c83363
1 file changed +2 -8
refs.c
+2 -8
@@ -857,12 +857,6 @@ static int nonmatching_ref_fn(struct ref_entry *entry, void *vdata)
857 return 1;
858 }
859
860 -static void report_refname_conflict(struct ref_entry *entry,
861 - const char *refname)
862 -{
863 - error("'%s' exists; cannot create '%s'", entry->name, refname);
864 -}
865 -
860 /*
861 * Return true iff a reference named refname could be created without
862 * conflicting with the name of an existing reference in dir. If
@@ -918,7 +912,7 @@ static int is_refname_available(const char *refname,
912 */
913 return 1;
914 }
921 - report_refname_conflict(entry, refname);
915 + error("'%s' exists; cannot create '%s'", entry->name, refname);
916 return 0;
917 }
918
@@ -969,7 +963,7 @@ static int is_refname_available(const char *refname,
963 if (!do_for_each_entry_in_dir(dir, 0, nonmatching_ref_fn, &data))
964 return 1;
965
972 - report_refname_conflict(data.found, refname);
966 + error("'%s' exists; cannot create '%s'", data.found->name, refname);
967 return 0;
968 }
969