summaryrefslogtreecommitdiff
path: root/t/helper
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2018-07-20 16:33:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-07-20 22:38:55 (GMT)
commit5cd52de3264a0a93fad8a0a770445657438bf660 (patch)
tree36c403d9b52cfff029de0431d977c86474818647 /t/helper
parentab176ac4ae9456a97ff4904c0222c6a0fc63a130 (diff)
downloadgit-5cd52de3264a0a93fad8a0a770445657438bf660.zip
git-5cd52de3264a0a93fad8a0a770445657438bf660.tar.gz
git-5cd52de3264a0a93fad8a0a770445657438bf660.tar.bz2
test-reach: test in_merge_bases
Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper')
-rw-r--r--t/helper/test-reach.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/helper/test-reach.c b/t/helper/test-reach.c
index 620bb46..f93ad50 100644
--- a/t/helper/test-reach.c
+++ b/t/helper/test-reach.c
@@ -9,6 +9,7 @@
int cmd__reach(int ac, const char **av)
{
struct object_id oid_A, oid_B;
+ struct commit *A, *B;
struct strbuf buf = STRBUF_INIT;
struct repository *r = the_repository;
@@ -17,6 +18,7 @@ int cmd__reach(int ac, const char **av)
if (ac < 2)
exit(1);
+ A = B = NULL;
while (strbuf_getline(&buf, stdin) != EOF) {
struct object_id oid;
@@ -44,10 +46,12 @@ int cmd__reach(int ac, const char **av)
switch (buf.buf[0]) {
case 'A':
oidcpy(&oid_A, &oid);
+ A = c;
break;
case 'B':
oidcpy(&oid_B, &oid);
+ B = c;
break;
default:
@@ -58,6 +62,8 @@ int cmd__reach(int ac, const char **av)
if (!strcmp(av[1], "ref_newer"))
printf("%s(A,B):%d\n", av[1], ref_newer(&oid_A, &oid_B));
+ else if (!strcmp(av[1], "in_merge_bases"))
+ printf("%s(A,B):%d\n", av[1], in_merge_bases(A, B));
exit(0);
}