Skip to content

Commit 65e7a44

Browse files
peffgitster
authored andcommitted
refs: drop some unused parameters from create_symref_lock()
This function was factored out in 57d0b1e (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b9849e4 commit 65e7a44

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

refs/files-backend.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1961,9 +1961,8 @@ static int create_ref_symlink(struct ref_lock *lock, const char *target)
19611961
return ret;
19621962
}
19631963

1964-
static int create_symref_lock(struct files_ref_store *refs,
1965-
struct ref_lock *lock, const char *refname,
1966-
const char *target, struct strbuf *err)
1964+
static int create_symref_lock(struct ref_lock *lock, const char *target,
1965+
struct strbuf *err)
19671966
{
19681967
if (!fdopen_lock_file(&lock->lk, "w")) {
19691968
strbuf_addf(err, "unable to fdopen %s: %s",
@@ -2579,8 +2578,7 @@ static int lock_ref_for_update(struct files_ref_store *refs,
25792578
}
25802579

25812580
if (update->new_target && !(update->flags & REF_LOG_ONLY)) {
2582-
if (create_symref_lock(refs, lock, update->refname,
2583-
update->new_target, err)) {
2581+
if (create_symref_lock(lock, update->new_target, err)) {
25842582
ret = TRANSACTION_GENERIC_ERROR;
25852583
goto out;
25862584
}

0 commit comments

Comments
 (0)