зеркало из https://github.com/microsoft/git.git
Merge branch 'ab/various-leak-fixes'
Leak fixes. * ab/various-leak-fixes: push: free_refs() the "local_refs" in set_refspecs() push: refactor refspec_append_mapped() for subsequent leak-fix receive-pack: release the linked "struct command *" list grep API: plug memory leaks by freeing "header_list" grep.c: refactor free_grep_patterns() builtin/merge.c: free "&buf" on "Your local changes..." error builtin/merge.c: use fixed strings, not "strbuf", fix leak show-branch: free() allocated "head" before return commit-graph: fix a parse_options_concat() leak http-backend.c: fix cmd_main() memory leak, refactor reg{exec,free}() http-backend.c: fix "dir" and "cmd_arg" leaks in cmd_main() worktree: fix a trivial leak in prune_worktrees() repack: fix leaks on error with "goto cleanup" name-rev: don't xstrdup() an already dup'd string various: add missing clear_pathspec(), fix leaks clone: use free() instead of UNLEAK() commit-graph: use free_commit_graph() instead of UNLEAK() bundle.c: don't leak the "args" in the "struct child_process" tests: mark tests as passing with SANITIZE=leak
This commit is contained in:
Коммит
72972ea0b9
|
@ -710,6 +710,7 @@ int write_archive(int argc, const char **argv, const char *prefix,
|
||||||
|
|
||||||
string_list_clear_func(&args.extra_files, extra_file_info_clear);
|
string_list_clear_func(&args.extra_files, extra_file_info_clear);
|
||||||
free(args.refname);
|
free(args.refname);
|
||||||
|
clear_pathspec(&args.pathspec);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1092,5 +1092,6 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
|
||||||
strbuf_release(&buf);
|
strbuf_release(&buf);
|
||||||
string_list_clear(&del_list, 0);
|
string_list_clear(&del_list, 0);
|
||||||
string_list_clear(&exclude_list, 0);
|
string_list_clear(&exclude_list, 0);
|
||||||
|
clear_pathspec(&pathspec);
|
||||||
return (errors != 0);
|
return (errors != 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -892,6 +892,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
|
||||||
int is_bundle = 0, is_local;
|
int is_bundle = 0, is_local;
|
||||||
int reject_shallow = 0;
|
int reject_shallow = 0;
|
||||||
const char *repo_name, *repo, *work_tree, *git_dir;
|
const char *repo_name, *repo, *work_tree, *git_dir;
|
||||||
|
char *repo_to_free = NULL;
|
||||||
char *path = NULL, *dir, *display_repo = NULL;
|
char *path = NULL, *dir, *display_repo = NULL;
|
||||||
int dest_exists, real_dest_exists = 0;
|
int dest_exists, real_dest_exists = 0;
|
||||||
const struct ref *refs, *remote_head;
|
const struct ref *refs, *remote_head;
|
||||||
|
@ -949,7 +950,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
|
||||||
path = get_repo_path(repo_name, &is_bundle);
|
path = get_repo_path(repo_name, &is_bundle);
|
||||||
if (path) {
|
if (path) {
|
||||||
FREE_AND_NULL(path);
|
FREE_AND_NULL(path);
|
||||||
repo = absolute_pathdup(repo_name);
|
repo = repo_to_free = absolute_pathdup(repo_name);
|
||||||
} else if (strchr(repo_name, ':')) {
|
} else if (strchr(repo_name, ':')) {
|
||||||
repo = repo_name;
|
repo = repo_name;
|
||||||
display_repo = transport_anonymize_url(repo);
|
display_repo = transport_anonymize_url(repo);
|
||||||
|
@ -1417,7 +1418,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
|
||||||
free(unborn_head);
|
free(unborn_head);
|
||||||
free(dir);
|
free(dir);
|
||||||
free(path);
|
free(path);
|
||||||
UNLEAK(repo);
|
free(repo_to_free);
|
||||||
junk_mode = JUNK_LEAVE_ALL;
|
junk_mode = JUNK_LEAVE_ALL;
|
||||||
|
|
||||||
transport_ls_refs_options_release(&transport_ls_refs_options);
|
transport_ls_refs_options_release(&transport_ls_refs_options);
|
||||||
|
|
|
@ -67,6 +67,7 @@ static int graph_verify(int argc, const char **argv, const char *prefix)
|
||||||
int fd;
|
int fd;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
|
int ret;
|
||||||
|
|
||||||
static struct option builtin_commit_graph_verify_options[] = {
|
static struct option builtin_commit_graph_verify_options[] = {
|
||||||
OPT_BOOL(0, "shallow", &opts.shallow,
|
OPT_BOOL(0, "shallow", &opts.shallow,
|
||||||
|
@ -111,8 +112,9 @@ static int graph_verify(int argc, const char **argv, const char *prefix)
|
||||||
if (!graph)
|
if (!graph)
|
||||||
return !!open_ok;
|
return !!open_ok;
|
||||||
|
|
||||||
UNLEAK(graph);
|
ret = verify_commit_graph(the_repository, graph, flags);
|
||||||
return verify_commit_graph(the_repository, graph, flags);
|
free_commit_graph(graph);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int read_replace_refs;
|
extern int read_replace_refs;
|
||||||
|
@ -267,8 +269,8 @@ static int graph_write(int argc, const char **argv, const char *prefix)
|
||||||
|
|
||||||
if (opts.reachable) {
|
if (opts.reachable) {
|
||||||
if (write_commit_graph_reachable(odb, flags, &write_opts))
|
if (write_commit_graph_reachable(odb, flags, &write_opts))
|
||||||
return 1;
|
result = 1;
|
||||||
return 0;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opts.stdin_packs) {
|
if (opts.stdin_packs) {
|
||||||
|
|
|
@ -1560,7 +1560,9 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
|
||||||
!common->next &&
|
!common->next &&
|
||||||
oideq(&common->item->object.oid, &head_commit->object.oid)) {
|
oideq(&common->item->object.oid, &head_commit->object.oid)) {
|
||||||
/* Again the most common case of merging one remote. */
|
/* Again the most common case of merging one remote. */
|
||||||
struct strbuf msg = STRBUF_INIT;
|
const char *msg = have_message ?
|
||||||
|
"Fast-forward (no commit created; -m option ignored)" :
|
||||||
|
"Fast-forward";
|
||||||
struct commit *commit;
|
struct commit *commit;
|
||||||
|
|
||||||
if (verbosity >= 0) {
|
if (verbosity >= 0) {
|
||||||
|
@ -1570,10 +1572,6 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
|
||||||
find_unique_abbrev(&remoteheads->item->object.oid,
|
find_unique_abbrev(&remoteheads->item->object.oid,
|
||||||
DEFAULT_ABBREV));
|
DEFAULT_ABBREV));
|
||||||
}
|
}
|
||||||
strbuf_addstr(&msg, "Fast-forward");
|
|
||||||
if (have_message)
|
|
||||||
strbuf_addstr(&msg,
|
|
||||||
" (no commit created; -m option ignored)");
|
|
||||||
commit = remoteheads->item;
|
commit = remoteheads->item;
|
||||||
if (!commit) {
|
if (!commit) {
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
@ -1592,9 +1590,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
finish(head_commit, remoteheads, &commit->object.oid, msg.buf);
|
finish(head_commit, remoteheads, &commit->object.oid, msg);
|
||||||
remove_merge_branch_state(the_repository);
|
remove_merge_branch_state(the_repository);
|
||||||
strbuf_release(&msg);
|
|
||||||
goto done;
|
goto done;
|
||||||
} else if (!remoteheads->next && common->next)
|
} else if (!remoteheads->next && common->next)
|
||||||
;
|
;
|
||||||
|
@ -1621,7 +1618,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
|
||||||
error(_("Your local changes to the following files would be overwritten by merge:\n %s"),
|
error(_("Your local changes to the following files would be overwritten by merge:\n %s"),
|
||||||
sb.buf);
|
sb.buf);
|
||||||
strbuf_release(&sb);
|
strbuf_release(&sb);
|
||||||
return 2;
|
ret = 2;
|
||||||
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See if it is really trivial. */
|
/* See if it is really trivial. */
|
||||||
|
|
|
@ -265,17 +265,6 @@ static int subpath_matches(const char *path, const char *filter)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *name_ref_abbrev(const char *refname, int shorten_unambiguous)
|
|
||||||
{
|
|
||||||
if (shorten_unambiguous)
|
|
||||||
refname = shorten_unambiguous_ref(refname, 0);
|
|
||||||
else if (skip_prefix(refname, "refs/heads/", &refname))
|
|
||||||
; /* refname already advanced */
|
|
||||||
else
|
|
||||||
skip_prefix(refname, "refs/", &refname);
|
|
||||||
return refname;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct name_ref_data {
|
struct name_ref_data {
|
||||||
int tags_only;
|
int tags_only;
|
||||||
int name_only;
|
int name_only;
|
||||||
|
@ -301,11 +290,19 @@ static void add_to_tip_table(const struct object_id *oid, const char *refname,
|
||||||
int shorten_unambiguous, struct commit *commit,
|
int shorten_unambiguous, struct commit *commit,
|
||||||
timestamp_t taggerdate, int from_tag, int deref)
|
timestamp_t taggerdate, int from_tag, int deref)
|
||||||
{
|
{
|
||||||
refname = name_ref_abbrev(refname, shorten_unambiguous);
|
char *short_refname = NULL;
|
||||||
|
|
||||||
|
if (shorten_unambiguous)
|
||||||
|
short_refname = shorten_unambiguous_ref(refname, 0);
|
||||||
|
else if (skip_prefix(refname, "refs/heads/", &refname))
|
||||||
|
; /* refname already advanced */
|
||||||
|
else
|
||||||
|
skip_prefix(refname, "refs/", &refname);
|
||||||
|
|
||||||
ALLOC_GROW(tip_table.table, tip_table.nr + 1, tip_table.alloc);
|
ALLOC_GROW(tip_table.table, tip_table.nr + 1, tip_table.alloc);
|
||||||
oidcpy(&tip_table.table[tip_table.nr].oid, oid);
|
oidcpy(&tip_table.table[tip_table.nr].oid, oid);
|
||||||
tip_table.table[tip_table.nr].refname = xstrdup(refname);
|
tip_table.table[tip_table.nr].refname = short_refname ?
|
||||||
|
short_refname : xstrdup(refname);
|
||||||
tip_table.table[tip_table.nr].commit = commit;
|
tip_table.table[tip_table.nr].commit = commit;
|
||||||
tip_table.table[tip_table.nr].taggerdate = taggerdate;
|
tip_table.table[tip_table.nr].taggerdate = taggerdate;
|
||||||
tip_table.table[tip_table.nr].from_tag = from_tag;
|
tip_table.table[tip_table.nr].from_tag = from_tag;
|
||||||
|
|
|
@ -63,16 +63,9 @@ static struct refspec rs = REFSPEC_INIT_PUSH;
|
||||||
static struct string_list push_options_config = STRING_LIST_INIT_DUP;
|
static struct string_list push_options_config = STRING_LIST_INIT_DUP;
|
||||||
|
|
||||||
static void refspec_append_mapped(struct refspec *refspec, const char *ref,
|
static void refspec_append_mapped(struct refspec *refspec, const char *ref,
|
||||||
struct remote *remote, struct ref *local_refs)
|
struct remote *remote, struct ref *matched)
|
||||||
{
|
{
|
||||||
const char *branch_name;
|
const char *branch_name;
|
||||||
struct ref *matched = NULL;
|
|
||||||
|
|
||||||
/* Does "ref" uniquely name our ref? */
|
|
||||||
if (count_refspec_match(ref, local_refs, &matched) != 1) {
|
|
||||||
refspec_append(refspec, ref);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (remote->push.nr) {
|
if (remote->push.nr) {
|
||||||
struct refspec_item query;
|
struct refspec_item query;
|
||||||
|
@ -120,15 +113,28 @@ static void set_refspecs(const char **refs, int nr, const char *repo)
|
||||||
die(_("--delete only accepts plain target ref names"));
|
die(_("--delete only accepts plain target ref names"));
|
||||||
refspec_appendf(&rs, ":%s", ref);
|
refspec_appendf(&rs, ":%s", ref);
|
||||||
} else if (!strchr(ref, ':')) {
|
} else if (!strchr(ref, ':')) {
|
||||||
if (!remote) {
|
struct ref *matched = NULL;
|
||||||
/* lazily grab remote and local_refs */
|
|
||||||
remote = remote_get(repo);
|
/* lazily grab local_refs */
|
||||||
|
if (!local_refs)
|
||||||
local_refs = get_local_heads();
|
local_refs = get_local_heads();
|
||||||
|
|
||||||
|
/* Does "ref" uniquely name our ref? */
|
||||||
|
if (count_refspec_match(ref, local_refs, &matched) != 1) {
|
||||||
|
refspec_append(&rs, ref);
|
||||||
|
} else {
|
||||||
|
/* lazily grab remote */
|
||||||
|
if (!remote)
|
||||||
|
remote = remote_get(repo);
|
||||||
|
if (!remote)
|
||||||
|
BUG("must get a remote for repo '%s'", repo);
|
||||||
|
|
||||||
|
refspec_append_mapped(&rs, ref, remote, matched);
|
||||||
}
|
}
|
||||||
refspec_append_mapped(&rs, ref, remote, local_refs);
|
|
||||||
} else
|
} else
|
||||||
refspec_append(&rs, ref);
|
refspec_append(&rs, ref);
|
||||||
}
|
}
|
||||||
|
free_refs(local_refs);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int push_url_of_remote(struct remote *remote, const char ***url_p)
|
static int push_url_of_remote(struct remote *remote, const char ***url_p)
|
||||||
|
|
|
@ -2032,6 +2032,16 @@ static struct command **queue_command(struct command **tail,
|
||||||
return &cmd->next;
|
return &cmd->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void free_commands(struct command *commands)
|
||||||
|
{
|
||||||
|
while (commands) {
|
||||||
|
struct command *next = commands->next;
|
||||||
|
|
||||||
|
free(commands);
|
||||||
|
commands = next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void queue_commands_from_cert(struct command **tail,
|
static void queue_commands_from_cert(struct command **tail,
|
||||||
struct strbuf *push_cert)
|
struct strbuf *push_cert)
|
||||||
{
|
{
|
||||||
|
@ -2569,6 +2579,7 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
|
||||||
run_receive_hook(commands, "post-receive", 1,
|
run_receive_hook(commands, "post-receive", 1,
|
||||||
&push_options);
|
&push_options);
|
||||||
run_update_post_hook(commands);
|
run_update_post_hook(commands);
|
||||||
|
free_commands(commands);
|
||||||
string_list_clear(&push_options, 0);
|
string_list_clear(&push_options, 0);
|
||||||
if (auto_gc) {
|
if (auto_gc) {
|
||||||
struct child_process proc = CHILD_PROCESS_INIT;
|
struct child_process proc = CHILD_PROCESS_INIT;
|
||||||
|
|
|
@ -948,7 +948,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
|
||||||
|
|
||||||
ret = start_command(&cmd);
|
ret = start_command(&cmd);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto cleanup;
|
||||||
|
|
||||||
if (geometry) {
|
if (geometry) {
|
||||||
FILE *in = xfdopen(cmd.in, "w");
|
FILE *in = xfdopen(cmd.in, "w");
|
||||||
|
@ -977,7 +977,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
|
||||||
fclose(out);
|
fclose(out);
|
||||||
ret = finish_command(&cmd);
|
ret = finish_command(&cmd);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto cleanup;
|
||||||
|
|
||||||
if (!names.nr && !po_args.quiet)
|
if (!names.nr && !po_args.quiet)
|
||||||
printf_ln(_("Nothing new to pack."));
|
printf_ln(_("Nothing new to pack."));
|
||||||
|
@ -1007,7 +1007,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
|
||||||
&existing_nonkept_packs,
|
&existing_nonkept_packs,
|
||||||
&existing_kept_packs);
|
&existing_kept_packs);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto cleanup;
|
||||||
|
|
||||||
if (delete_redundant && expire_to) {
|
if (delete_redundant && expire_to) {
|
||||||
/*
|
/*
|
||||||
|
@ -1039,7 +1039,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
|
||||||
&existing_nonkept_packs,
|
&existing_nonkept_packs,
|
||||||
&existing_kept_packs);
|
&existing_kept_packs);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1115,7 +1115,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
|
||||||
string_list_clear(&include, 0);
|
string_list_clear(&include, 0);
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
reprepare_packed_git(the_repository);
|
reprepare_packed_git(the_repository);
|
||||||
|
@ -1172,10 +1172,11 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
|
||||||
write_midx_file(get_object_directory(), NULL, NULL, flags);
|
write_midx_file(get_object_directory(), NULL, NULL, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cleanup:
|
||||||
string_list_clear(&names, 1);
|
string_list_clear(&names, 1);
|
||||||
string_list_clear(&existing_nonkept_packs, 0);
|
string_list_clear(&existing_nonkept_packs, 0);
|
||||||
string_list_clear(&existing_kept_packs, 0);
|
string_list_clear(&existing_kept_packs, 0);
|
||||||
clear_pack_geometry(geometry);
|
clear_pack_geometry(geometry);
|
||||||
|
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -391,8 +391,9 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
|
||||||
if (reset_type != NONE)
|
if (reset_type != NONE)
|
||||||
die(_("options '%s' and '%s' cannot be used together"), "--patch", "--{hard,mixed,soft}");
|
die(_("options '%s' and '%s' cannot be used together"), "--patch", "--{hard,mixed,soft}");
|
||||||
trace2_cmd_mode("patch-interactive");
|
trace2_cmd_mode("patch-interactive");
|
||||||
return !!run_add_p(the_repository, ADD_P_RESET, rev,
|
update_ref_status = !!run_add_p(the_repository, ADD_P_RESET, rev,
|
||||||
&pathspec);
|
&pathspec);
|
||||||
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* git reset tree [--] paths... can be used to
|
/* git reset tree [--] paths... can be used to
|
||||||
|
@ -441,8 +442,10 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
|
||||||
LOCK_DIE_ON_ERROR);
|
LOCK_DIE_ON_ERROR);
|
||||||
if (reset_type == MIXED) {
|
if (reset_type == MIXED) {
|
||||||
int flags = quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN;
|
int flags = quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN;
|
||||||
if (read_from_tree(&pathspec, &oid, intent_to_add))
|
if (read_from_tree(&pathspec, &oid, intent_to_add)) {
|
||||||
return 1;
|
update_ref_status = 1;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
the_index.updated_skipworktree = 1;
|
the_index.updated_skipworktree = 1;
|
||||||
if (!no_refresh && get_git_work_tree()) {
|
if (!no_refresh && get_git_work_tree()) {
|
||||||
uint64_t t_begin, t_delta_in_ms;
|
uint64_t t_begin, t_delta_in_ms;
|
||||||
|
@ -490,5 +493,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
|
||||||
|
|
||||||
discard_index(&the_index);
|
discard_index(&the_index);
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
clear_pathspec(&pathspec);
|
||||||
return update_ref_status;
|
return update_ref_status;
|
||||||
}
|
}
|
||||||
|
|
|
@ -956,5 +956,6 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
|
||||||
if (shown_merge_point && --extra < 0)
|
if (shown_merge_point && --extra < 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
free(head);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1731,6 +1731,7 @@ static int push_stash(int argc, const char **argv, const char *prefix,
|
||||||
OPT_PATHSPEC_FILE_NUL(&pathspec_file_nul),
|
OPT_PATHSPEC_FILE_NUL(&pathspec_file_nul),
|
||||||
OPT_END()
|
OPT_END()
|
||||||
};
|
};
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (argc) {
|
if (argc) {
|
||||||
force_assume = !strcmp(argv[0], "-p");
|
force_assume = !strcmp(argv[0], "-p");
|
||||||
|
@ -1770,8 +1771,10 @@ static int push_stash(int argc, const char **argv, const char *prefix,
|
||||||
die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file");
|
die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file");
|
||||||
}
|
}
|
||||||
|
|
||||||
return do_push_stash(&ps, stash_msg, quiet, keep_index, patch_mode,
|
ret = do_push_stash(&ps, stash_msg, quiet, keep_index, patch_mode,
|
||||||
include_untracked, only_staged);
|
include_untracked, only_staged);
|
||||||
|
clear_pathspec(&ps);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int push_stash_unassumed(int argc, const char **argv, const char *prefix)
|
static int push_stash_unassumed(int argc, const char **argv, const char *prefix)
|
||||||
|
|
|
@ -173,7 +173,7 @@ static void prune_worktrees(void)
|
||||||
{
|
{
|
||||||
struct strbuf reason = STRBUF_INIT;
|
struct strbuf reason = STRBUF_INIT;
|
||||||
struct strbuf main_path = STRBUF_INIT;
|
struct strbuf main_path = STRBUF_INIT;
|
||||||
struct string_list kept = STRING_LIST_INIT_NODUP;
|
struct string_list kept = STRING_LIST_INIT_DUP;
|
||||||
DIR *dir = opendir(git_path("worktrees"));
|
DIR *dir = opendir(git_path("worktrees"));
|
||||||
struct dirent *d;
|
struct dirent *d;
|
||||||
if (!dir)
|
if (!dir)
|
||||||
|
@ -184,14 +184,14 @@ static void prune_worktrees(void)
|
||||||
if (should_prune_worktree(d->d_name, &reason, &path, expire))
|
if (should_prune_worktree(d->d_name, &reason, &path, expire))
|
||||||
prune_worktree(d->d_name, reason.buf);
|
prune_worktree(d->d_name, reason.buf);
|
||||||
else if (path)
|
else if (path)
|
||||||
string_list_append(&kept, path)->util = xstrdup(d->d_name);
|
string_list_append_nodup(&kept, path)->util = xstrdup(d->d_name);
|
||||||
}
|
}
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
|
|
||||||
strbuf_add_absolute_path(&main_path, get_git_common_dir());
|
strbuf_add_absolute_path(&main_path, get_git_common_dir());
|
||||||
/* massage main worktree absolute path to match 'gitdir' content */
|
/* massage main worktree absolute path to match 'gitdir' content */
|
||||||
strbuf_strip_suffix(&main_path, "/.");
|
strbuf_strip_suffix(&main_path, "/.");
|
||||||
string_list_append(&kept, strbuf_detach(&main_path, NULL));
|
string_list_append_nodup(&kept, strbuf_detach(&main_path, NULL));
|
||||||
prune_dups(&kept);
|
prune_dups(&kept);
|
||||||
string_list_clear(&kept, 1);
|
string_list_clear(&kept, 1);
|
||||||
|
|
||||||
|
|
6
bundle.c
6
bundle.c
|
@ -610,6 +610,10 @@ int unbundle(struct repository *r, struct bundle_header *header,
|
||||||
enum verify_bundle_flags flags)
|
enum verify_bundle_flags flags)
|
||||||
{
|
{
|
||||||
struct child_process ip = CHILD_PROCESS_INIT;
|
struct child_process ip = CHILD_PROCESS_INIT;
|
||||||
|
|
||||||
|
if (verify_bundle(r, header, flags))
|
||||||
|
return -1;
|
||||||
|
|
||||||
strvec_pushl(&ip.args, "index-pack", "--fix-thin", "--stdin", NULL);
|
strvec_pushl(&ip.args, "index-pack", "--fix-thin", "--stdin", NULL);
|
||||||
|
|
||||||
/* If there is a filter, then we need to create the promisor pack. */
|
/* If there is a filter, then we need to create the promisor pack. */
|
||||||
|
@ -621,8 +625,6 @@ int unbundle(struct repository *r, struct bundle_header *header,
|
||||||
strvec_clear(extra_index_pack_args);
|
strvec_clear(extra_index_pack_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (verify_bundle(r, header, flags))
|
|
||||||
return -1;
|
|
||||||
ip.in = bundle_fd;
|
ip.in = bundle_fd;
|
||||||
ip.no_stdout = 1;
|
ip.no_stdout = 1;
|
||||||
ip.git_cmd = 1;
|
ip.git_cmd = 1;
|
||||||
|
|
15
grep.c
15
grep.c
|
@ -815,11 +815,11 @@ static void free_pattern_expr(struct grep_expr *x)
|
||||||
free(x);
|
free(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_grep_patterns(struct grep_opt *opt)
|
static void free_grep_pat(struct grep_pat *pattern)
|
||||||
{
|
{
|
||||||
struct grep_pat *p, *n;
|
struct grep_pat *p, *n;
|
||||||
|
|
||||||
for (p = opt->pattern_list; p; p = n) {
|
for (p = pattern; p; p = n) {
|
||||||
n = p->next;
|
n = p->next;
|
||||||
switch (p->token) {
|
switch (p->token) {
|
||||||
case GREP_PATTERN: /* atom */
|
case GREP_PATTERN: /* atom */
|
||||||
|
@ -836,10 +836,15 @@ void free_grep_patterns(struct grep_opt *opt)
|
||||||
}
|
}
|
||||||
free(p);
|
free(p);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!opt->pattern_expression)
|
void free_grep_patterns(struct grep_opt *opt)
|
||||||
return;
|
{
|
||||||
free_pattern_expr(opt->pattern_expression);
|
free_grep_pat(opt->pattern_list);
|
||||||
|
free_grep_pat(opt->header_list);
|
||||||
|
|
||||||
|
if (opt->pattern_expression)
|
||||||
|
free_pattern_expr(opt->pattern_expression);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *end_of_line(const char *cp, unsigned long *left)
|
static const char *end_of_line(const char *cp, unsigned long *left)
|
||||||
|
|
|
@ -759,10 +759,14 @@ int cmd_main(int argc, const char **argv)
|
||||||
struct service_cmd *c = &services[i];
|
struct service_cmd *c = &services[i];
|
||||||
regex_t re;
|
regex_t re;
|
||||||
regmatch_t out[1];
|
regmatch_t out[1];
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (regcomp(&re, c->pattern, REG_EXTENDED))
|
if (regcomp(&re, c->pattern, REG_EXTENDED))
|
||||||
die("Bogus regex in service table: %s", c->pattern);
|
die("Bogus regex in service table: %s", c->pattern);
|
||||||
if (!regexec(&re, dir, 1, out, 0)) {
|
ret = regexec(&re, dir, 1, out, 0);
|
||||||
|
regfree(&re);
|
||||||
|
|
||||||
|
if (!ret) {
|
||||||
size_t n;
|
size_t n;
|
||||||
|
|
||||||
if (strcmp(method, c->method))
|
if (strcmp(method, c->method))
|
||||||
|
@ -774,7 +778,6 @@ int cmd_main(int argc, const char **argv)
|
||||||
dir[out[0].rm_so] = 0;
|
dir[out[0].rm_so] = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
regfree(&re);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cmd)
|
if (!cmd)
|
||||||
|
@ -786,6 +789,7 @@ int cmd_main(int argc, const char **argv)
|
||||||
if (!getenv("GIT_HTTP_EXPORT_ALL") &&
|
if (!getenv("GIT_HTTP_EXPORT_ALL") &&
|
||||||
access("git-daemon-export-ok", F_OK) )
|
access("git-daemon-export-ok", F_OK) )
|
||||||
not_found(&hdr, "Repository not exported: '%s'", dir);
|
not_found(&hdr, "Repository not exported: '%s'", dir);
|
||||||
|
free(dir);
|
||||||
|
|
||||||
http_config();
|
http_config();
|
||||||
max_request_buffer = git_env_ulong("GIT_HTTP_MAX_REQUEST_BUFFER",
|
max_request_buffer = git_env_ulong("GIT_HTTP_MAX_REQUEST_BUFFER",
|
||||||
|
@ -795,5 +799,6 @@ int cmd_main(int argc, const char **argv)
|
||||||
setenv(GIT_PROTOCOL_ENVIRONMENT, proto_header, 0);
|
setenv(GIT_PROTOCOL_ENVIRONMENT, proto_header, 0);
|
||||||
|
|
||||||
cmd->imp(&hdr, cmd_arg);
|
cmd->imp(&hdr, cmd_arg);
|
||||||
|
free(cmd_arg);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
test_description='Test am with auto.crlf'
|
test_description='Test am with auto.crlf'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
cat >patchfile <<\EOF
|
cat >patchfile <<\EOF
|
||||||
|
|
|
@ -9,6 +9,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
TEST_CREATE_REPO_NO_TEMPLATE=1
|
TEST_CREATE_REPO_NO_TEMPLATE=1
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
# Remove a default ACL from the test dir if possible.
|
# Remove a default ACL from the test dir if possible.
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
test_description='Test repository version check'
|
test_description='Test repository version check'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success 'setup' '
|
test_expect_success 'setup' '
|
||||||
|
|
|
@ -9,6 +9,7 @@ test_description='Test repository with default ACL'
|
||||||
# => this must come before . ./test-lib.sh
|
# => this must come before . ./test-lib.sh
|
||||||
umask 077
|
umask 077
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
# We need an arbitrary other user give permission to using ACLs. root
|
# We need an arbitrary other user give permission to using ACLs. root
|
||||||
|
|
|
@ -5,6 +5,7 @@ test_description='packed-refs entries are covered by loose refs'
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success setup '
|
test_expect_success setup '
|
||||||
|
|
|
@ -7,6 +7,7 @@ test_description='Test prune and reflog expiration'
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
check_have () {
|
check_have () {
|
||||||
|
|
|
@ -5,6 +5,7 @@ test_description='reference transaction hooks'
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success setup '
|
test_expect_success setup '
|
||||||
|
|
|
@ -14,6 +14,8 @@ so.
|
||||||
These tests _might_ catch such overruns in normal use, but should be run with
|
These tests _might_ catch such overruns in normal use, but should be run with
|
||||||
ASan or valgrind for more confidence.
|
ASan or valgrind for more confidence.
|
||||||
'
|
'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
# the general idea for tags and commits is to build up the "base" file
|
# the general idea for tags and commits is to build up the "base" file
|
||||||
|
|
|
@ -5,6 +5,7 @@ test_description='prune $GIT_DIR/worktrees'
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success initialize '
|
test_expect_success initialize '
|
||||||
|
|
|
@ -5,6 +5,7 @@ test_description='test git worktree list'
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success 'setup' '
|
test_expect_success 'setup' '
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
test_description='test git worktree repair'
|
test_description='test git worktree repair'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success setup '
|
test_expect_success setup '
|
||||||
|
|
|
@ -12,6 +12,7 @@ semantic is still the same.
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success 'enable reflogs' '
|
test_expect_success 'enable reflogs' '
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
test_description='git mktag: tag object verify test'
|
test_description='git mktag: tag object verify test'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
###########################################################
|
###########################################################
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
test_description='test subject preservation with format-patch | am'
|
test_description='test subject preservation with format-patch | am'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
make_patches() {
|
make_patches() {
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
test_description='git am with corrupt input'
|
test_description='git am with corrupt input'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
make_mbox_with_nul () {
|
make_mbox_with_nul () {
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
test_description='test format=flowed support of git am'
|
test_description='test format=flowed support of git am'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success 'setup' '
|
test_expect_success 'setup' '
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
test_description='am --interactive tests'
|
test_description='am --interactive tests'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success 'set up patches to apply' '
|
test_expect_success 'set up patches to apply' '
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
test_description='git archive attribute tests'
|
test_description='git archive attribute tests'
|
||||||
|
|
||||||
TEST_CREATE_REPO_NO_TEMPLATE=1
|
TEST_CREATE_REPO_NO_TEMPLATE=1
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
SUBSTFORMAT='%H (%h)%n'
|
SUBSTFORMAT='%H (%h)%n'
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
test_description='test corner cases of git-archive'
|
test_description='test corner cases of git-archive'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
# the 10knuls.tar file is used to test for an empty git generated tar
|
# the 10knuls.tar file is used to test for an empty git generated tar
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
test_description='pack index with 64-bit offsets and object CRC'
|
test_description='pack index with 64-bit offsets and object CRC'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success 'setup' '
|
test_expect_success 'setup' '
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
test_description='git-pack-object with missing base
|
test_description='git-pack-object with missing base
|
||||||
|
|
||||||
'
|
'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
# Create A-B chain
|
# Create A-B chain
|
||||||
|
|
|
@ -14,6 +14,7 @@ what currently happens. If that changes, these tests should be revisited.
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success 'disable reflogs' '
|
test_expect_success 'disable reflogs' '
|
||||||
|
|
|
@ -5,6 +5,7 @@ test_description='git pack-objects using object filtering'
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
# Test blob:none filter.
|
# Test blob:none filter.
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
test_description='test for no lazy fetch with the commit-graph'
|
test_description='test for no lazy fetch with the commit-graph'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success 'setup: prepare a repository with a commit' '
|
test_expect_success 'setup: prepare a repository with a commit' '
|
||||||
|
|
|
@ -7,6 +7,7 @@ test_description='Test the post-checkout hook.'
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success setup '
|
test_expect_success setup '
|
||||||
|
|
|
@ -5,6 +5,7 @@ test_description='forced push to replace commit we do not have'
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success setup '
|
test_expect_success setup '
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
test_description='remote push rejects are reported by client'
|
test_description='remote push rejects are reported by client'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success 'setup' '
|
test_expect_success 'setup' '
|
||||||
|
|
|
@ -5,6 +5,7 @@ test_description='test quickfetch from local'
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success setup '
|
test_expect_success setup '
|
||||||
|
|
|
@ -4,6 +4,7 @@ test_description='fetch/receive strict mode'
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success 'setup and inject "corrupt or missing" object' '
|
test_expect_success 'setup and inject "corrupt or missing" object' '
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
test_description='check environment showed to remote side of transports'
|
test_description='check environment showed to remote side of transports'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success 'set up "remote" push situation' '
|
test_expect_success 'set up "remote" push situation' '
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
test_description='pulling from symlinked subdir'
|
test_description='pulling from symlinked subdir'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
# The scenario we are building:
|
# The scenario we are building:
|
||||||
|
|
|
@ -4,6 +4,7 @@ test_description='push with --set-upstream'
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
. "$TEST_DIRECTORY"/lib-terminal.sh
|
. "$TEST_DIRECTORY"/lib-terminal.sh
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ test_description='test fetching of oddly-named refs'
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
# afterwards we will have:
|
# afterwards we will have:
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
test_description='detect some push errors early (before contacting remote)'
|
test_description='detect some push errors early (before contacting remote)'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success 'setup commits' '
|
test_expect_success 'setup commits' '
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
test_description='check receive input limits'
|
test_description='check receive input limits'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
# Let's run tests with different unpack limits: 1 and 10000
|
# Let's run tests with different unpack limits: 1 and 10000
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
test_description='check quarantine of objects during push'
|
test_description='check quarantine of objects during push'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success 'create picky dest repo' '
|
test_expect_success 'create picky dest repo' '
|
||||||
|
|
|
@ -4,6 +4,7 @@ test_description='test git-http-backend-noserver'
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
HTTPD_DOCUMENT_ROOT_PATH="$TRASH_DIRECTORY"
|
HTTPD_DOCUMENT_ROOT_PATH="$TRASH_DIRECTORY"
|
||||||
|
|
|
@ -4,6 +4,7 @@ test_description='test git-http-backend'
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
. "$TEST_DIRECTORY"/lib-httpd.sh
|
. "$TEST_DIRECTORY"/lib-httpd.sh
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
test_description='test git-http-backend respects CONTENT_LENGTH'
|
test_description='test git-http-backend respects CONTENT_LENGTH'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_lazy_prereq GZIP 'gzip --version'
|
test_lazy_prereq GZIP 'gzip --version'
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
test_description='pull signature verification tests'
|
test_description='pull signature verification tests'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
. "$TEST_DIRECTORY/lib-gpg.sh"
|
. "$TEST_DIRECTORY/lib-gpg.sh"
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ test_description='test clone --reference'
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
base_dir=$(pwd)
|
base_dir=$(pwd)
|
||||||
|
|
|
@ -4,6 +4,7 @@ test_description='basic clone options'
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success 'setup' '
|
test_expect_success 'setup' '
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
test_description='test transitive info/alternate entries'
|
test_description='test transitive info/alternate entries'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success 'preparing first repository' '
|
test_expect_success 'preparing first repository' '
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
test_description='session ID in capabilities'
|
test_description='session ID in capabilities'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
REPO="$(pwd)/repo"
|
REPO="$(pwd)/repo"
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
test_description='test disabling of local paths in clone/fetch'
|
test_description='test disabling of local paths in clone/fetch'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
. "$TEST_DIRECTORY/lib-proto-disable.sh"
|
. "$TEST_DIRECTORY/lib-proto-disable.sh"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
test_description='test disabling of git-over-ssh in clone/fetch'
|
test_description='test disabling of git-over-ssh in clone/fetch'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
. "$TEST_DIRECTORY/lib-proto-disable.sh"
|
. "$TEST_DIRECTORY/lib-proto-disable.sh"
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
test_description='git rev-list should notice bad commits'
|
test_description='git rev-list should notice bad commits'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
# Note:
|
# Note:
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
test_description='--all includes detached HEADs'
|
test_description='--all includes detached HEADs'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
test_description='git rev-list --exclude-hidden test'
|
test_description='git rev-list --exclude-hidden test'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success 'setup' '
|
test_expect_success 'setup' '
|
||||||
|
|
|
@ -5,6 +5,7 @@ test_description='unpack-trees error messages'
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@ test_description='check pruning of dependent objects'
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
# We care about reachability, so we do not want to use
|
# We care about reachability, so we do not want to use
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
test_description='git reset --patch'
|
test_description='git reset --patch'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./lib-patch-mode.sh
|
. ./lib-patch-mode.sh
|
||||||
|
|
||||||
test_expect_success PERL 'setup' '
|
test_expect_success PERL 'setup' '
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
test_description='git reset should work on unborn branch'
|
test_description='git reset should work on unborn branch'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success 'setup' '
|
test_expect_success 'setup' '
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
test_description='reset --pathspec-from-file'
|
test_description='reset --pathspec-from-file'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_tick
|
test_tick
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
test_description='git clean -i basic tests'
|
test_description='git clean -i basic tests'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
. "$TEST_DIRECTORY"/lib-terminal.sh
|
. "$TEST_DIRECTORY"/lib-terminal.sh
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ These tests exercise the "git submodule sync" subcommand.
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success setup '
|
test_expect_success setup '
|
||||||
|
|
|
@ -13,6 +13,7 @@ TEST_NO_CREATE_REPO=1
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success 'setup' '
|
test_expect_success 'setup' '
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
test_description='check handling of disallowed .gitmodule urls'
|
test_description='check handling of disallowed .gitmodule urls'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success 'setup' '
|
test_expect_success 'setup' '
|
||||||
|
|
|
@ -12,6 +12,8 @@ Such as:
|
||||||
|
|
||||||
- symlinked .gitmodules, etc
|
- symlinked .gitmodules, etc
|
||||||
'
|
'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
. "$TEST_DIRECTORY"/lib-pack.sh
|
. "$TEST_DIRECTORY"/lib-pack.sh
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ test_description='merge signature verification tests'
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
. "$TEST_DIRECTORY/lib-gpg.sh"
|
. "$TEST_DIRECTORY/lib-gpg.sh"
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ test_description='git repack works correctly'
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
fsha1=
|
fsha1=
|
||||||
|
|
Загрузка…
Ссылка в новой задаче