]> git.ipfire.org Git - thirdparty/git.git/blobdiff - refs/files-backend.c
ref_update_reject_duplicates(): expose function to whole refs module
[thirdparty/git.git] / refs / files-backend.c
index 19842d2e5637aa3f40b982ba306d6821d267b929..8d0ce739a602b69df5ea2bc77ecd6b8c9a6ec4e3 100644 (file)
@@ -2512,23 +2512,6 @@ static struct ref_iterator *files_reflog_iterator_begin(struct ref_store *ref_st
        return ref_iterator;
 }
 
-static int ref_update_reject_duplicates(struct string_list *refnames,
-                                       struct strbuf *err)
-{
-       int i, n = refnames->nr;
-
-       assert(err);
-
-       for (i = 1; i < n; i++)
-               if (!strcmp(refnames->items[i - 1].string, refnames->items[i].string)) {
-                       strbuf_addf(err,
-                                   "multiple updates for ref '%s' not allowed.",
-                                   refnames->items[i].string);
-                       return 1;
-               }
-       return 0;
-}
-
 /*
  * If update is a direct update of head_ref (the reference pointed to
  * by HEAD), then add an extra REF_LOG_ONLY update for HEAD.