git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
blob ab93f9f51f555cb66718188b2655baa7f76af091 939 bytes (raw)
name: t/helper/test-authors.c 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
 
#include "cache.h"
#include "authors.h"

static const char *usage_msg = "\n"
"  test-authors split [authors_info]\n"
"  test-authors has-multiple-authors [authors]\n";

static void test_split_authors(const char **argv)
{
	struct authors_split split;
	int result;
	struct strbuf splitted = STRBUF_INIT;

	printf("%s -> ",*argv);
	result = split_authors_line(&split, *argv, strlen(*argv));
	if (result)
		printf("error");
	else {
		strbuf_add(&splitted, split.begin, split.end - split.begin);
		printf(splitted.buf);
	}
	printf("\n");
}

static void test_has_multiple_authors(const char **argv)
{
	printf("%s -> %s\n", *argv, has_multiple_authors(*argv) ? "yes" : "no");
}

int cmd_main(int argc, const char **argv)
{
	argv++;
	if (argc != 3)
		usage(usage_msg);
	if (!strcmp(*argv, "split"))
		test_split_authors(argv+1);
	else if (!strcmp(*argv, "has-multiple"))
		test_has_multiple_authors(argv+1);
	else
		usage(usage_msg);
	return 0;
}

debug log:

solving ab93f9f ...
found ab93f9f in https://public-inbox.org/git/1485713194-11782-1-git-send-email-schumacher@kde.org/

applying [1/1] https://public-inbox.org/git/1485713194-11782-1-git-send-email-schumacher@kde.org/
diff --git a/t/helper/test-authors.c b/t/helper/test-authors.c
new file mode 100644
index 0000000..ab93f9f

Checking patch t/helper/test-authors.c...
Applied patch t/helper/test-authors.c cleanly.

index at:
100644 ab93f9f51f555cb66718188b2655baa7f76af091	t/helper/test-authors.c

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).