зеркало из 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);
|
||||
free(args.refname);
|
||||
clear_pathspec(&args.pathspec);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
|
@ -1092,5 +1092,6 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
|
|||
strbuf_release(&buf);
|
||||
string_list_clear(&del_list, 0);
|
||||
string_list_clear(&exclude_list, 0);
|
||||
clear_pathspec(&pathspec);
|
||||
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 reject_shallow = 0;
|
||||
const char *repo_name, *repo, *work_tree, *git_dir;
|
||||
char *repo_to_free = NULL;
|
||||
char *path = NULL, *dir, *display_repo = NULL;
|
||||
int dest_exists, real_dest_exists = 0;
|
||||
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);
|
||||
if (path) {
|
||||
FREE_AND_NULL(path);
|
||||
repo = absolute_pathdup(repo_name);
|
||||
repo = repo_to_free = absolute_pathdup(repo_name);
|
||||
} else if (strchr(repo_name, ':')) {
|
||||
repo = repo_name;
|
||||
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(dir);
|
||||
free(path);
|
||||
UNLEAK(repo);
|
||||
free(repo_to_free);
|
||||
junk_mode = JUNK_LEAVE_ALL;
|
||||
|
||||
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;
|
||||
struct stat st;
|
||||
int flags = 0;
|
||||
int ret;
|
||||
|
||||
static struct option builtin_commit_graph_verify_options[] = {
|
||||
OPT_BOOL(0, "shallow", &opts.shallow,
|
||||
|
@ -111,8 +112,9 @@ static int graph_verify(int argc, const char **argv, const char *prefix)
|
|||
if (!graph)
|
||||
return !!open_ok;
|
||||
|
||||
UNLEAK(graph);
|
||||
return verify_commit_graph(the_repository, graph, flags);
|
||||
ret = verify_commit_graph(the_repository, graph, flags);
|
||||
free_commit_graph(graph);
|
||||
return ret;
|
||||
}
|
||||
|
||||
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 (write_commit_graph_reachable(odb, flags, &write_opts))
|
||||
return 1;
|
||||
return 0;
|
||||
result = 1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (opts.stdin_packs) {
|
||||
|
|
|
@ -1560,7 +1560,9 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
|
|||
!common->next &&
|
||||
oideq(&common->item->object.oid, &head_commit->object.oid)) {
|
||||
/* 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;
|
||||
|
||||
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,
|
||||
DEFAULT_ABBREV));
|
||||
}
|
||||
strbuf_addstr(&msg, "Fast-forward");
|
||||
if (have_message)
|
||||
strbuf_addstr(&msg,
|
||||
" (no commit created; -m option ignored)");
|
||||
commit = remoteheads->item;
|
||||
if (!commit) {
|
||||
ret = 1;
|
||||
|
@ -1592,9 +1590,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
|
|||
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);
|
||||
strbuf_release(&msg);
|
||||
goto done;
|
||||
} 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"),
|
||||
sb.buf);
|
||||
strbuf_release(&sb);
|
||||
return 2;
|
||||
ret = 2;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* See if it is really trivial. */
|
||||
|
|
|
@ -265,17 +265,6 @@ static int subpath_matches(const char *path, const char *filter)
|
|||
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 {
|
||||
int tags_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,
|
||||
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);
|
||||
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].taggerdate = taggerdate;
|
||||
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 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;
|
||||
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) {
|
||||
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"));
|
||||
refspec_appendf(&rs, ":%s", ref);
|
||||
} else if (!strchr(ref, ':')) {
|
||||
if (!remote) {
|
||||
/* lazily grab remote and local_refs */
|
||||
remote = remote_get(repo);
|
||||
struct ref *matched = NULL;
|
||||
|
||||
/* lazily grab local_refs */
|
||||
if (!local_refs)
|
||||
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
|
||||
refspec_append(&rs, ref);
|
||||
}
|
||||
free_refs(local_refs);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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,
|
||||
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,
|
||||
&push_options);
|
||||
run_update_post_hook(commands);
|
||||
free_commands(commands);
|
||||
string_list_clear(&push_options, 0);
|
||||
if (auto_gc) {
|
||||
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);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto cleanup;
|
||||
|
||||
if (geometry) {
|
||||
FILE *in = xfdopen(cmd.in, "w");
|
||||
|
@ -977,7 +977,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
|
|||
fclose(out);
|
||||
ret = finish_command(&cmd);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto cleanup;
|
||||
|
||||
if (!names.nr && !po_args.quiet)
|
||||
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_kept_packs);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto cleanup;
|
||||
|
||||
if (delete_redundant && expire_to) {
|
||||
/*
|
||||
|
@ -1039,7 +1039,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
|
|||
&existing_nonkept_packs,
|
||||
&existing_kept_packs);
|
||||
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);
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
cleanup:
|
||||
string_list_clear(&names, 1);
|
||||
string_list_clear(&existing_nonkept_packs, 0);
|
||||
string_list_clear(&existing_kept_packs, 0);
|
||||
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)
|
||||
die(_("options '%s' and '%s' cannot be used together"), "--patch", "--{hard,mixed,soft}");
|
||||
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);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* 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);
|
||||
if (reset_type == MIXED) {
|
||||
int flags = quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN;
|
||||
if (read_from_tree(&pathspec, &oid, intent_to_add))
|
||||
return 1;
|
||||
if (read_from_tree(&pathspec, &oid, intent_to_add)) {
|
||||
update_ref_status = 1;
|
||||
goto cleanup;
|
||||
}
|
||||
the_index.updated_skipworktree = 1;
|
||||
if (!no_refresh && get_git_work_tree()) {
|
||||
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);
|
||||
|
||||
cleanup:
|
||||
clear_pathspec(&pathspec);
|
||||
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)
|
||||
break;
|
||||
}
|
||||
free(head);
|
||||
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_END()
|
||||
};
|
||||
int ret;
|
||||
|
||||
if (argc) {
|
||||
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");
|
||||
}
|
||||
|
||||
return do_push_stash(&ps, stash_msg, quiet, keep_index, patch_mode,
|
||||
include_untracked, only_staged);
|
||||
ret = do_push_stash(&ps, stash_msg, quiet, keep_index, patch_mode,
|
||||
include_untracked, only_staged);
|
||||
clear_pathspec(&ps);
|
||||
return ret;
|
||||
}
|
||||
|
||||
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 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"));
|
||||
struct dirent *d;
|
||||
if (!dir)
|
||||
|
@ -184,14 +184,14 @@ static void prune_worktrees(void)
|
|||
if (should_prune_worktree(d->d_name, &reason, &path, expire))
|
||||
prune_worktree(d->d_name, reason.buf);
|
||||
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);
|
||||
|
||||
strbuf_add_absolute_path(&main_path, get_git_common_dir());
|
||||
/* massage main worktree absolute path to match 'gitdir' content */
|
||||
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);
|
||||
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)
|
||||
{
|
||||
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);
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
if (verify_bundle(r, header, flags))
|
||||
return -1;
|
||||
ip.in = bundle_fd;
|
||||
ip.no_stdout = 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);
|
||||
}
|
||||
|
||||
void free_grep_patterns(struct grep_opt *opt)
|
||||
static void free_grep_pat(struct grep_pat *pattern)
|
||||
{
|
||||
struct grep_pat *p, *n;
|
||||
|
||||
for (p = opt->pattern_list; p; p = n) {
|
||||
for (p = pattern; p; p = n) {
|
||||
n = p->next;
|
||||
switch (p->token) {
|
||||
case GREP_PATTERN: /* atom */
|
||||
|
@ -836,10 +836,15 @@ void free_grep_patterns(struct grep_opt *opt)
|
|||
}
|
||||
free(p);
|
||||
}
|
||||
}
|
||||
|
||||
if (!opt->pattern_expression)
|
||||
return;
|
||||
free_pattern_expr(opt->pattern_expression);
|
||||
void free_grep_patterns(struct grep_opt *opt)
|
||||
{
|
||||
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)
|
||||
|
|
|
@ -759,10 +759,14 @@ int cmd_main(int argc, const char **argv)
|
|||
struct service_cmd *c = &services[i];
|
||||
regex_t re;
|
||||
regmatch_t out[1];
|
||||
int ret;
|
||||
|
||||
if (regcomp(&re, c->pattern, REG_EXTENDED))
|
||||
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;
|
||||
|
||||
if (strcmp(method, c->method))
|
||||
|
@ -774,7 +778,6 @@ int cmd_main(int argc, const char **argv)
|
|||
dir[out[0].rm_so] = 0;
|
||||
break;
|
||||
}
|
||||
regfree(&re);
|
||||
}
|
||||
|
||||
if (!cmd)
|
||||
|
@ -786,6 +789,7 @@ int cmd_main(int argc, const char **argv)
|
|||
if (!getenv("GIT_HTTP_EXPORT_ALL") &&
|
||||
access("git-daemon-export-ok", F_OK) )
|
||||
not_found(&hdr, "Repository not exported: '%s'", dir);
|
||||
free(dir);
|
||||
|
||||
http_config();
|
||||
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);
|
||||
|
||||
cmd->imp(&hdr, cmd_arg);
|
||||
free(cmd_arg);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
test_description='Test am with auto.crlf'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
cat >patchfile <<\EOF
|
||||
|
|
|
@ -9,6 +9,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
|||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_CREATE_REPO_NO_TEMPLATE=1
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
# Remove a default ACL from the test dir if possible.
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
test_description='Test repository version check'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'setup' '
|
||||
|
|
|
@ -9,6 +9,7 @@ test_description='Test repository with default ACL'
|
|||
# => this must come before . ./test-lib.sh
|
||||
umask 077
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
# 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
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success setup '
|
||||
|
|
|
@ -7,6 +7,7 @@ test_description='Test prune and reflog expiration'
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
check_have () {
|
||||
|
|
|
@ -5,6 +5,7 @@ test_description='reference transaction hooks'
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success setup '
|
||||
|
|
|
@ -14,6 +14,8 @@ so.
|
|||
These tests _might_ catch such overruns in normal use, but should be run with
|
||||
ASan or valgrind for more confidence.
|
||||
'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
# 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
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success initialize '
|
||||
|
|
|
@ -5,6 +5,7 @@ test_description='test git worktree list'
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'setup' '
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
test_description='test git worktree repair'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success setup '
|
||||
|
|
|
@ -12,6 +12,7 @@ semantic is still the same.
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'enable reflogs' '
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
test_description='git mktag: tag object verify test'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
###########################################################
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
test_description='test subject preservation with format-patch | am'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
make_patches() {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
test_description='git am with corrupt input'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
make_mbox_with_nul () {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
test_description='test format=flowed support of git am'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'setup' '
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
test_description='am --interactive tests'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'set up patches to apply' '
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
test_description='git archive attribute tests'
|
||||
|
||||
TEST_CREATE_REPO_NO_TEMPLATE=1
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
SUBSTFORMAT='%H (%h)%n'
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
test_description='test corner cases of git-archive'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
# 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_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'setup' '
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
test_description='git-pack-object with missing base
|
||||
|
||||
'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
# 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
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'disable reflogs' '
|
||||
|
|
|
@ -5,6 +5,7 @@ test_description='git pack-objects using object filtering'
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
# Test blob:none filter.
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
test_description='test for no lazy fetch with the commit-graph'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
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
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
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
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success setup '
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
test_description='remote push rejects are reported by client'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'setup' '
|
||||
|
|
|
@ -5,6 +5,7 @@ test_description='test quickfetch from local'
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success setup '
|
||||
|
|
|
@ -4,6 +4,7 @@ test_description='fetch/receive strict mode'
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'setup and inject "corrupt or missing" object' '
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
test_description='check environment showed to remote side of transports'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'set up "remote" push situation' '
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
test_description='pulling from symlinked subdir'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
# The scenario we are building:
|
||||
|
|
|
@ -4,6 +4,7 @@ test_description='push with --set-upstream'
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.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
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
# afterwards we will have:
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
test_description='detect some push errors early (before contacting remote)'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'setup commits' '
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
test_description='check receive input limits'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
# Let's run tests with different unpack limits: 1 and 10000
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
test_description='check quarantine of objects during push'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
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
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
HTTPD_DOCUMENT_ROOT_PATH="$TRASH_DIRECTORY"
|
||||
|
|
|
@ -4,6 +4,7 @@ test_description='test git-http-backend'
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
. "$TEST_DIRECTORY"/lib-httpd.sh
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
test_description='test git-http-backend respects CONTENT_LENGTH'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_lazy_prereq GZIP 'gzip --version'
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
test_description='pull signature verification tests'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
. "$TEST_DIRECTORY/lib-gpg.sh"
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ test_description='test clone --reference'
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
base_dir=$(pwd)
|
||||
|
|
|
@ -4,6 +4,7 @@ test_description='basic clone options'
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'setup' '
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
#
|
||||
|
||||
test_description='test transitive info/alternate entries'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'preparing first repository' '
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
test_description='session ID in capabilities'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
REPO="$(pwd)/repo"
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
test_description='test disabling of local paths in clone/fetch'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
. "$TEST_DIRECTORY/lib-proto-disable.sh"
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
test_description='test disabling of git-over-ssh in clone/fetch'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
. "$TEST_DIRECTORY/lib-proto-disable.sh"
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
test_description='git rev-list should notice bad commits'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
# Note:
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
test_description='--all includes detached HEADs'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
test_description='git rev-list --exclude-hidden test'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'setup' '
|
||||
|
|
|
@ -5,6 +5,7 @@ test_description='unpack-trees error messages'
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ test_description='check pruning of dependent objects'
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
# We care about reachability, so we do not want to use
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
test_description='git reset --patch'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./lib-patch-mode.sh
|
||||
|
||||
test_expect_success PERL 'setup' '
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
test_description='git reset should work on unborn branch'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'setup' '
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
test_description='reset --pathspec-from-file'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_tick
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
test_description='git clean -i basic tests'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.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
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success setup '
|
||||
|
|
|
@ -13,6 +13,7 @@ TEST_NO_CREATE_REPO=1
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'setup' '
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
test_description='check handling of disallowed .gitmodule urls'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'setup' '
|
||||
|
|
|
@ -12,6 +12,8 @@ Such as:
|
|||
|
||||
- symlinked .gitmodules, etc
|
||||
'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
. "$TEST_DIRECTORY"/lib-pack.sh
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ test_description='merge signature verification tests'
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
. "$TEST_DIRECTORY/lib-gpg.sh"
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ test_description='git repack works correctly'
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
fsha1=
|
||||
|
|
Загрузка…
Ссылка в новой задаче