diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-10-30 08:00:19 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-10-30 08:00:19 -0700 |
| commit | 48d0b6545a8ed22db087e766499c1bcf8cd0075e (patch) | |
| tree | 4c1e033d1b9d354795ff064e8383a3c913e9a98f /refs/files-backend.c | |
| parent | 923436e23d0da21350363422809e2ae9e18c97d3 (diff) | |
| parent | f570bd91b3b2c6c5ef2035e3ce3ed76e613e74a7 (diff) | |
Merge branch 'ps/symlink-symref-deprecation'
"Symlink symref" has been added to the list of things that will
disappear at Git 3.0 boundary.
* ps/symlink-symref-deprecation:
refs/files: deprecate writing symrefs as symbolic links
Diffstat (limited to 'refs/files-backend.c')
| -rw-r--r-- | refs/files-backend.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c index 8d7007f4aa..054cf42f4e 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -2113,20 +2113,35 @@ static int commit_ref_update(struct files_ref_store *refs, return 0; } -#ifdef NO_SYMLINK_HEAD +#if defined(NO_SYMLINK_HEAD) || defined(WITH_BREAKING_CHANGES) #define create_ref_symlink(a, b) (-1) #else static int create_ref_symlink(struct ref_lock *lock, const char *target) { + static int warn_once = 1; + char *ref_path; int ret = -1; - char *ref_path = get_locked_file_path(&lock->lk); + 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"); + + if (warn_once) + warning(_("'core.preferSymlinkRefs=true' is nominated for removal.\n" + "hint: The use of symbolic links for symbolic refs is deprecated\n" + "hint: and will be removed in Git 3.0. The configuration that\n" + "hint: tells Git to use them is thus going away. You can unset\n" + "hint: it with:\n" + "hint:\n" + "hint:\tgit config unset core.preferSymlinkRefs\n" + "hint:\n" + "hint: Git will then use the textual symref format instead.")); + warn_once = 0; + return ret; } #endif |
