diff options
Diffstat (limited to 't/helper/test-reach.c')
-rw-r--r-- | t/helper/test-reach.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/t/helper/test-reach.c b/t/helper/test-reach.c index 5dd374379c..84deee604a 100644 --- a/t/helper/test-reach.c +++ b/t/helper/test-reach.c @@ -67,13 +67,13 @@ int cmd__reach(int ac, const char **av) peeled = deref_tag_noverify(the_repository, orig); if (!peeled) - die("failed to load commit for input %s resulting in oid %s\n", + die("failed to load commit for input %s resulting in oid %s", buf.buf, oid_to_hex(&oid)); c = object_as_type(peeled, OBJ_COMMIT, 0); if (!c) - die("failed to load commit for input %s resulting in oid %s\n", + die("failed to load commit for input %s resulting in oid %s", buf.buf, oid_to_hex(&oid)); switch (buf.buf[0]) { @@ -116,6 +116,8 @@ int cmd__reach(int ac, const char **av) repo_in_merge_bases_many(the_repository, A, X_nr, X_array, 0)); else if (!strcmp(av[1], "is_descendant_of")) printf("%s(A,X):%d\n", av[1], repo_is_descendant_of(r, A, X)); + else if (!strcmp(av[1], "get_branch_base_for_tip")) + printf("%s(A,X):%d\n", av[1], get_branch_base_for_tip(r, A, X_array, X_nr)); else if (!strcmp(av[1], "get_merge_bases_many")) { struct commit_list *list = NULL; if (repo_get_merge_bases_many(the_repository, @@ -125,10 +127,12 @@ int cmd__reach(int ac, const char **av) exit(128); printf("%s(A,X):\n", av[1]); print_sorted_commit_ids(list); + free_commit_list(list); } else if (!strcmp(av[1], "reduce_heads")) { struct commit_list *list = reduce_heads(X); printf("%s(X):\n", av[1]); print_sorted_commit_ids(list); + free_commit_list(list); } else if (!strcmp(av[1], "can_all_from_reach")) { printf("%s(X,Y):%d\n", av[1], can_all_from_reach(X, Y, 1)); } else if (!strcmp(av[1], "can_all_from_reach_with_flag")) { @@ -151,6 +155,7 @@ int cmd__reach(int ac, const char **av) filter.with_commit_tag_algo = 0; printf("%s(_,A,X,_):%d\n", av[1], commit_contains(&filter, A, X, &cache)); + clear_contains_cache(&cache); } else if (!strcmp(av[1], "get_reachable_subset")) { const int reachable_flag = 1; int i, count = 0; @@ -174,7 +179,14 @@ int cmd__reach(int ac, const char **av) die(_("too many commits marked reachable")); print_sorted_commit_ids(list); + free_commit_list(list); } + object_array_clear(&X_obj); + strbuf_release(&buf); + free_commit_list(X); + free_commit_list(Y); + free(X_array); + free(Y_array); return 0; } |