summaryrefslogtreecommitdiffstats
path: root/builtin/clone.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-17 09:21:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-17 09:21:27 +0000
commit9aa26a8f9d0ef8bd948b1d22be8fd8ad0a870627 (patch)
treed76df30628d9e87be87c27fc525dfd207c60ed52 /builtin/clone.c
parentAdding debian version 1:2.45.1-1. (diff)
downloadgit-9aa26a8f9d0ef8bd948b1d22be8fd8ad0a870627.tar.xz
git-9aa26a8f9d0ef8bd948b1d22be8fd8ad0a870627.zip
Merging upstream version 1:2.45.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'builtin/clone.c')
-rw-r--r--builtin/clone.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index 221edbc..5fbe39f 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -967,8 +967,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
int hash_algo;
unsigned int ref_storage_format = REF_STORAGE_FORMAT_UNKNOWN;
const int do_not_override_repo_unix_permissions = -1;
- const char *template_dir;
- char *template_dir_dup = NULL;
struct transport_ls_refs_options transport_ls_refs_options =
TRANSPORT_LS_REFS_OPTIONS_INIT;
@@ -988,13 +986,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
usage_msg_opt(_("You must specify a repository to clone."),
builtin_clone_usage, builtin_clone_options);
- xsetenv("GIT_CLONE_PROTECTION_ACTIVE", "true", 0 /* allow user override */);
- template_dir = get_template_dir(option_template);
- if (*template_dir && !is_absolute_path(template_dir))
- template_dir = template_dir_dup =
- absolute_pathdup(template_dir);
- xsetenv("GIT_CLONE_TEMPLATE_DIR", template_dir, 1);
-
if (option_depth || option_since || option_not.nr)
deepen = 1;
if (option_single_branch == -1)
@@ -1156,7 +1147,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
* repository, and reference backends may persist that information into
* their on-disk data structures.
*/
- init_db(git_dir, real_git_dir, template_dir, GIT_HASH_UNKNOWN,
+ init_db(git_dir, real_git_dir, option_template, GIT_HASH_UNKNOWN,
ref_storage_format, NULL,
do_not_override_repo_unix_permissions, INIT_DB_QUIET | INIT_DB_SKIP_REFDB);
@@ -1545,7 +1536,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
free(dir);
free(path);
free(repo_to_free);
- free(template_dir_dup);
+ UNLEAK(repo);
junk_mode = JUNK_LEAVE_ALL;
transport_ls_refs_options_release(&transport_ls_refs_options);