aboutsummaryrefslogtreecommitdiffstats
path: root/submodule.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-08-15 13:22:14 -0700
committerJunio C Hamano <gitster@pobox.com>2024-08-15 13:22:14 -0700
commit88457a6151ca7bd46ce1a809f9740340b712e242 (patch)
treebc108eecd535ff369dddb3b04bd2be3e21d82d6d /submodule.c
parent6891103f7206f2a46c579ec87f4f61482e377a27 (diff)
parent6f1e9394e2e02d16dfbef02c1585a1acfd2a5118 (diff)
downloadgit-88457a6151ca7bd46ce1a809f9740340b712e242.tar.gz
Merge branch 'ps/submodule-ref-format'
Support to specify ref backend for submodules has been enhanced. * ps/submodule-ref-format: object: fix leaking packfiles when closing object store submodule: fix leaking seen submodule names submodule: fix leaking fetch tasks builtin/submodule: allow "add" to use different ref storage format refs: fix ref storage format for submodule ref stores builtin/clone: propagate ref storage format to submodules builtin/submodule: allow cloning with different ref storage format git-submodule.sh: break overly long command lines
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/submodule.c b/submodule.c
index ab99a30253..13b8f8c19c 100644
--- a/submodule.c
+++ b/submodule.c
@@ -1496,7 +1496,7 @@ static const struct submodule *get_non_gitmodules_submodule(const char *path)
return (const struct submodule *) ret;
}
-static void fetch_task_release(struct fetch_task *p)
+static void fetch_task_free(struct fetch_task *p)
{
if (p->free_sub)
free((void*)p->sub);
@@ -1508,6 +1508,7 @@ static void fetch_task_release(struct fetch_task *p)
FREE_AND_NULL(p->repo);
strvec_clear(&p->git_args);
+ free(p);
}
static struct repository *get_submodule_repo_for(struct repository *r,
@@ -1576,8 +1577,7 @@ static struct fetch_task *fetch_task_create(struct submodule_parallel_fetch *spf
return task;
cleanup:
- fetch_task_release(task);
- free(task);
+ fetch_task_free(task);
return NULL;
}
@@ -1607,8 +1607,7 @@ get_fetch_task_from_index(struct submodule_parallel_fetch *spf,
} else {
struct strbuf empty_submodule_path = STRBUF_INIT;
- fetch_task_release(task);
- free(task);
+ fetch_task_free(task);
/*
* An empty directory is normal,
@@ -1654,8 +1653,7 @@ get_fetch_task_from_changed(struct submodule_parallel_fetch *spf,
cs_data->path,
repo_find_unique_abbrev(the_repository, cs_data->super_oid, DEFAULT_ABBREV));
- fetch_task_release(task);
- free(task);
+ fetch_task_free(task);
continue;
}
@@ -1763,7 +1761,7 @@ static int fetch_start_failure(struct strbuf *err UNUSED,
spf->result = 1;
- fetch_task_release(task);
+ fetch_task_free(task);
return 0;
}
@@ -1828,8 +1826,7 @@ static int fetch_finish(int retvalue, struct strbuf *err UNUSED,
}
out:
- fetch_task_release(task);
-
+ fetch_task_free(task);
return 0;
}
@@ -1883,6 +1880,7 @@ int fetch_submodules(struct repository *r,
strvec_clear(&spf.args);
out:
free_submodules_data(&spf.changed_submodule_names);
+ string_list_clear(&spf.seen_submodule_names, 0);
return spf.result;
}