diff mbox series

[4/4] refs: remove the last remnants of core.preferSymlinkRefs

Message ID 20240918232825.2627999-5-gitster@pobox.com (mailing list archive)
State New
Headers show
Series deprecating core.preferSymlinkRefs | expand

Commit Message

Junio C Hamano Sept. 18, 2024, 11:28 p.m. UTC
This step is for some time after Git 3.0.

Now it is almost N years since we removed the support for the
variable at Git 3.0 boundary, it is time to remove the warning about
this ancient variable and the behaviour change we went through with
it.

This concludes the journey to make sure we no longer create a
symbolic link to represent a symref, while still recognising
existing ones.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/config/core.txt |  5 -----
 config.c                      |  5 -----
 environment.c                 |  1 -
 environment.h                 |  1 -
 refs/files-backend.c          |  5 -----
 t/t0600-reffiles-backend.sh   | 15 ++-------------
 6 files changed, 2 insertions(+), 30 deletions(-)
diff mbox series

Patch

diff --git a/Documentation/config/core.txt b/Documentation/config/core.txt
index a6f67cab27..1887da78e3 100644
--- a/Documentation/config/core.txt
+++ b/Documentation/config/core.txt
@@ -285,11 +285,6 @@  CIFS/Microsoft Windows.
 +
 False by default.
 
-core.preferSymlinkRefs (removed)::
-	Instead of the default "symref" format for HEAD and other
-	symbolic reference files, use symbolic links.  The support
-	for this variable was dropped in Git 3.0.
-
 core.alternateRefsCommand::
 	When advertising tips of available history from an alternate, use the shell to
 	execute the specified command instead of linkgit:git-for-each-ref[1]. The
diff --git a/config.c b/config.c
index 56b5862e59..8693cd510d 100644
--- a/config.c
+++ b/config.c
@@ -1445,11 +1445,6 @@  static int git_default_core_config(const char *var, const char *value,
 		return 0;
 	}
 
-	if (!strcmp(var, "core.prefersymlinkrefs")) {
-		prefer_symlink_refs = git_config_bool(var, value);
-		return 0;
-	}
-
 	if (!strcmp(var, "core.logallrefupdates")) {
 		if (value && !strcasecmp(value, "always"))
 			log_all_ref_updates = LOG_REFS_ALWAYS;
diff --git a/environment.c b/environment.c
index 1d6c48b52d..2c3a60149b 100644
--- a/environment.c
+++ b/environment.c
@@ -40,7 +40,6 @@  int has_symlinks = 1;
 int minimum_abbrev = 4, default_abbrev = -1;
 int ignore_case;
 int assume_unchanged;
-int prefer_symlink_refs;
 int is_bare_repository_cfg = -1; /* unspecified */
 int warn_ambiguous_refs = 1;
 int warn_on_object_refname_ambiguity = 1;
diff --git a/environment.h b/environment.h
index 0148738ed6..6b595bd210 100644
--- a/environment.h
+++ b/environment.h
@@ -127,7 +127,6 @@  extern int has_symlinks;
 extern int minimum_abbrev, default_abbrev;
 extern int ignore_case;
 extern int assume_unchanged;
-extern int prefer_symlink_refs;
 extern int warn_ambiguous_refs;
 extern int warn_on_object_refname_ambiguity;
 extern char *apply_default_whitespace;
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 1296272252..eef01fee06 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -2983,11 +2983,6 @@  static int files_transaction_finish(struct ref_store *ref_store,
 			}
 		}
 
-		/* Warn against core.preferSymlinkRefs set to true */
-		if (update->new_target && prefer_symlink_refs)
-			/* we used to, but no longer, create a symlink here */
-			warning("core.preferSymlinkRefs was removed in Git 3.0");
-
 		if (update->flags & REF_NEEDS_COMMIT) {
 			clear_loose_ref_cache(refs);
 			if (commit_ref(lock)) {
diff --git a/t/t0600-reffiles-backend.sh b/t/t0600-reffiles-backend.sh
index 4e517cdc13..4db86757ac 100755
--- a/t/t0600-reffiles-backend.sh
+++ b/t/t0600-reffiles-backend.sh
@@ -480,22 +480,12 @@  test_expect_success SYMLINKS 'symlinks used as symrefs are still supported' '
 	test_cmp actual expect
 '
 
-test_expect_success 'core.prefersymlinkrefs gets a warning' '
+test_expect_success 'core.prefersymlinkrefs no longer gets a warning' '
 	test_when_finished "git symbolic-ref -d TEST_SYMREF_HEAD || :" &&
 	git update-ref refs/heads/new HEAD &&
 
 	test_config core.prefersymlinkrefs true &&
 	git symbolic-ref TEST_SYMREF_HEAD refs/heads/new 2>stderr &&
-	test_grep "core\.preferSymlinkRefs was removed" stderr &&
-
-	git symbolic-ref -d TEST_SYMREF_HEAD &&
-	git config core.prefersymlinkrefs false &&
-	git symbolic-ref TEST_SYMREF_HEAD refs/heads/new 2>stderr &&
-	test_grep ! "core\.preferSymlinkRefs was removed" stderr &&
-
-	git symbolic-ref -d TEST_SYMREF_HEAD &&
-	git config --unset core.prefersymlinkrefs &&
-	git symbolic-ref TEST_SYMREF_HEAD refs/heads/new 2>stderr &&
 	test_grep ! "core\.preferSymlinkRefs was removed" stderr
 '
 
@@ -512,8 +502,7 @@  test_expect_success 'symref transaction' '
 	test_path_is_file .git/TEST_SYMREF_HEAD &&
 	git symbolic-ref TEST_SYMREF_HEAD >actual &&
 	echo refs/heads/new >expect &&
-	test_cmp expect actual &&
-	test_grep ! "core\.preferSymlinkRefs was removed" stderr
+	test_cmp expect actual
 '
 
 test_done