Skip to content

Commit

Permalink
Merge branch 'jc/unused-on-windows' into next
Browse files Browse the repository at this point in the history
* jc/unused-on-windows:
  refs/files-backend: work around -Wunused-parameter
  • Loading branch information
gitster committed Aug 30, 2024
2 parents e5961a9 + ab8bcd2 commit a2a2aa6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions refs/files-backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1946,20 +1946,23 @@ 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);
free(ref_path);

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)
Expand Down

0 comments on commit a2a2aa6

Please sign in to comment.