refs/files-backend: work around -Wunused-parameter
This is needed to build things with -Werror=unused-parameter on a platform without symbolic link support. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Aug 30, 2024 at 12:33 UTC
ab8bcd2dbd2f4e820d3bfb3d79b123655c52561b
1 file changed
+5
-2
refs/files-backend.c
+5
-2
@@ -1946,10 +1946,13 @@ static int commit_ref_update(struct files_ref_store *refs,
1946
return 0;
1947
}
1948
1949
+#ifdef NO_SYMLINK_HEAD
1950
+#define create_ref_symlink(a, b) (-1)
1951
+#else
1952
static int create_ref_symlink(struct ref_lock *lock, const char *target)
1953
{
1954
int ret = -1;
1952
-#ifndef NO_SYMLINK_HEAD
1955
+
1956
char *ref_path = get_locked_file_path(&lock->lk);
1957
unlink(ref_path);
1958
ret = symlink(target, ref_path);
@@ -1957,9 +1960,9 @@ static int create_ref_symlink(struct ref_lock *lock, const char *target)
1960
1961
if (ret)
1962
fprintf(stderr, "no symlink - falling back to symbolic ref\n");
1960
-#endif
1963
return ret;
1964
}
1965
+#endif
1966
1967
static int create_symref_lock(struct ref_lock *lock, const char *target,
1968
struct strbuf *err)