aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--refs.c9
-rw-r--r--refs/files-backend.c6
-rw-r--r--refs/refs-internal.h8
3 files changed, 7 insertions, 16 deletions
diff --git a/refs.c b/refs.c
index 22000798c7..b34969c792 100644
--- a/refs.c
+++ b/refs.c
@@ -2303,8 +2303,13 @@ cleanup:
return ret;
}
-int ref_update_reject_duplicates(struct string_list *refnames,
- struct strbuf *err)
+/*
+ * Write an error to `err` and return a nonzero value iff the same
+ * refname appears multiple times in `refnames`. `refnames` must be
+ * sorted on entry to this function.
+ */
+static int ref_update_reject_duplicates(struct string_list *refnames,
+ struct strbuf *err)
{
size_t i, n = refnames->nr;
diff --git a/refs/files-backend.c b/refs/files-backend.c
index ecf2df556d..73da0d70e8 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -3016,12 +3016,6 @@ static int files_transaction_finish_initial(struct files_ref_store *refs,
if (transaction->state != REF_TRANSACTION_PREPARED)
BUG("commit called for transaction that is not prepared");
- string_list_sort(&transaction->refnames);
- if (ref_update_reject_duplicates(&transaction->refnames, err)) {
- ret = TRANSACTION_GENERIC_ERROR;
- goto cleanup;
- }
-
/*
* It's really undefined to call this function in an active
* repository or when there are existing references: we are
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index 92db793026..6d3770d0cc 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -143,14 +143,6 @@ int refs_read_raw_ref(struct ref_store *ref_store, const char *refname,
unsigned int *type, int *failure_errno);
/*
- * Write an error to `err` and return a nonzero value iff the same
- * refname appears multiple times in `refnames`. `refnames` must be
- * sorted on entry to this function.
- */
-int ref_update_reject_duplicates(struct string_list *refnames,
- struct strbuf *err);
-
-/*
* Add a ref_update with the specified properties to transaction, and
* return a pointer to the new object. This function does not verify
* that refname is well-formed. new_oid and old_oid are only