{"thread":{"id":"62026","subject":"[PATCH] refs/files-backend: work around -Wunused-parameter","startedAt":"2024-08-30T19:33:16Z","lastAt":"2024-08-30T19:33:16Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"501933","messageId":"xmqqjzfxrekm.fsf@gitster.g","threadId":"62026","inReplyTo":null,"subject":"[PATCH] refs/files-backend: work around -Wunused-parameter","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-08-30T19:33:13Z","receivedAt":"2024-08-30T19:33:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This is needed to build things with -Werror=unused-parameter on a\nplatform without symbolic link support.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n refs/files-backend.c | 7 +++++--\n 1 file changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/refs/files-backend.c b/refs/files-backend.c\nindex 1cff65f6ae..4c5573b19c 100644\n--- a/refs/files-backend.c\n+++ b/refs/files-backend.c\n@@ -1946,10 +1946,13 @@ static int commit_ref_update(struct files_ref_store *refs,\n \treturn 0;\n }\n \n+#ifdef NO_SYMLINK_HEAD\n+#define create_ref_symlink(a, b) (-1)\n+#else\n static int create_ref_symlink(struct ref_lock *lock, const char *target)\n {\n \tint ret = -1;\n-#ifndef NO_SYMLINK_HEAD\n+\n \tchar *ref_path = get_locked_file_path(&lock->lk);\n \tunlink(ref_path);\n \tret = symlink(target, ref_path);\n@@ -1957,9 +1960,9 @@ static int create_ref_symlink(struct ref_lock *lock, const char *target)\n \n \tif (ret)\n \t\tfprintf(stderr, \"no symlink - falling back to symbolic ref\\n\");\n-#endif\n \treturn ret;\n }\n+#endif\n \n static int create_symref_lock(struct ref_lock *lock, const char *target,\n \t\t\t      struct strbuf *err)\n-- \n2.46.0-592-gd813a5bb5c\n\n"}]}