@@ -2094,39 +2094,6 @@ static int commit_ref_update(struct files_ref_store *refs,
20942094 return 0 ;
20952095}
20962096
2097- #if defined(NO_SYMLINK_HEAD ) || defined(WITH_BREAKING_CHANGES )
2098- #define create_ref_symlink (a , b ) (-1)
2099- #else
2100- static int create_ref_symlink (struct ref_lock * lock , const char * target )
2101- {
2102- static int warn_once = 1 ;
2103- char * ref_path ;
2104- int ret = -1 ;
2105-
2106- ref_path = get_locked_file_path (& lock -> lk );
2107- unlink (ref_path );
2108- ret = symlink (target , ref_path );
2109- free (ref_path );
2110-
2111- if (ret )
2112- fprintf (stderr , "no symlink - falling back to symbolic ref\n" );
2113-
2114- if (warn_once )
2115- warning (_ ("'core.preferSymlinkRefs=true' is nominated for removal.\n"
2116- "hint: The use of symbolic links for symbolic refs is deprecated\n"
2117- "hint: and will be removed in Git 3.0. The configuration that\n"
2118- "hint: tells Git to use them is thus going away. You can unset\n"
2119- "hint: it with:\n"
2120- "hint:\n"
2121- "hint:\tgit config unset core.preferSymlinkRefs\n"
2122- "hint:\n"
2123- "hint: Git will then use the textual symref format instead." ));
2124- warn_once = 0 ;
2125-
2126- return ret ;
2127- }
2128- #endif
2129-
21302097static int create_symref_lock (struct ref_lock * lock , const char * target ,
21312098 struct strbuf * err )
21322099{
@@ -3308,20 +3275,6 @@ static int files_transaction_finish(struct ref_store *ref_store,
33083275 }
33093276 }
33103277
3311- /*
3312- * We try creating a symlink, if that succeeds we continue to the
3313- * next update. If not, we try and create a regular symref.
3314- */
3315- if (update -> new_target && refs -> prefer_symlink_refs )
3316- /*
3317- * By using the `NOT_CONSTANT()` trick, we can avoid
3318- * errors by `clang`'s `-Wunreachable` logic that would
3319- * report that the `continue` statement is not reachable
3320- * when `NO_SYMLINK_HEAD` is `#define`d.
3321- */
3322- if (NOT_CONSTANT (!create_ref_symlink (lock , update -> new_target )))
3323- continue ;
3324-
33253278 if (update -> flags & REF_NEEDS_COMMIT ) {
33263279 clear_loose_ref_cache (refs );
33273280 if (commit_ref (lock )) {
0 commit comments