aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-09-06 10:38:51 -0700
committerJunio C Hamano <gitster@pobox.com>2024-09-06 10:38:51 -0700
commit21c66081ca726f300296a5c6d29088caf8740417 (patch)
treee73dc6504ba8f377d9c392a93927ce87957d4370
parent4476304a06e6dad284e0d75245cd32f01a01a8c7 (diff)
parentab8bcd2dbd2f4e820d3bfb3d79b123655c52561b (diff)
downloadgit-21c66081ca726f300296a5c6d29088caf8740417.tar.xz
Merge branch 'jc/unused-on-windows'
Fix more fallouts from -Werror=unused-parameter. * jc/unused-on-windows: refs/files-backend: work around -Wunused-parameter
-rw-r--r--refs/files-backend.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 1cff65f6ae..4c5573b19c 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1946,10 +1946,13 @@ static int commit_ref_update(struct files_ref_store *refs,
return 0;
}
+#ifdef NO_SYMLINK_HEAD
+#define create_ref_symlink(a, b) (-1)
+#else
static int create_ref_symlink(struct ref_lock *lock, const char *target)
{
int ret = -1;
-#ifndef NO_SYMLINK_HEAD
+
char *ref_path = get_locked_file_path(&lock->lk);
unlink(ref_path);
ret = symlink(target, ref_path);
@@ -1957,9 +1960,9 @@ static int create_ref_symlink(struct ref_lock *lock, const char *target)
if (ret)
fprintf(stderr, "no symlink - falling back to symbolic ref\n");
-#endif
return ret;
}
+#endif
static int create_symref_lock(struct ref_lock *lock, const char *target,
struct strbuf *err)