]> git.ipfire.org Git - thirdparty/git.git/commitdiff
refs: drop some unused parameters from create_symref_lock()
authorJeff King <peff@peff.net>
Sat, 17 Aug 2024 07:26:44 +0000 (03:26 -0400)
committerJunio C Hamano <gitster@pobox.com>
Sat, 17 Aug 2024 16:44:40 +0000 (09:44 -0700)
This function was factored out in 57d0b1e2ea (files-backend: extract out
`create_symref_lock()`, 2024-05-07), but we never look at the ref_store
or refname parameters. We just need the path, which is already contained
in the lockfile struct.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/files-backend.c

index 8d6ec9458d8fe3587ac3db575cab86ee7f8f2ae8..1cff65f6ae548b4f6a78b984a7ecc50c8e29969f 100644 (file)
@@ -1961,9 +1961,8 @@ static int create_ref_symlink(struct ref_lock *lock, const char *target)
        return ret;
 }
 
-static int create_symref_lock(struct files_ref_store *refs,
-                             struct ref_lock *lock, const char *refname,
-                             const char *target, struct strbuf *err)
+static int create_symref_lock(struct ref_lock *lock, const char *target,
+                             struct strbuf *err)
 {
        if (!fdopen_lock_file(&lock->lk, "w")) {
                strbuf_addf(err, "unable to fdopen %s: %s",
@@ -2579,8 +2578,7 @@ static int lock_ref_for_update(struct files_ref_store *refs,
        }
 
        if (update->new_target && !(update->flags & REF_LOG_ONLY)) {
-               if (create_symref_lock(refs, lock, update->refname,
-                                      update->new_target, err)) {
+               if (create_symref_lock(lock, update->new_target, err)) {
                        ret = TRANSACTION_GENERIC_ERROR;
                        goto out;
                }