git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
blob f5db6319c65ecbf4a08a0abeb504978da48b70c1 624 bytes (raw)
name: t/helper/test-crontab.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
 
#include "test-tool.h"
#include "cache.h"

/*
 * Usage: test-tool cron <file> [-l]
 *
 * If -l is specified, then write the contents of <file> to stdou.
 * Otherwise, write from stdin into <file>.
 */
int cmd__crontab(int argc, const char **argv)
{
	char a;
	FILE *from, *to;

	if (argc == 3 && !strcmp(argv[2], "-l")) {
		from = fopen(argv[1], "r");
		if (!from)
			return 0;
		to = stdout;
	} else if (argc == 2) {
		from = stdin;
		to = fopen(argv[1], "w");
	} else
		return error("unknown arguments");

	while ((a = fgetc(from)) != EOF)
		fputc(a, to);

	if (argc == 3)
		fclose(from);
	else
		fclose(to);

	return 0;
}

debug log:

solving f5db6319c6 ...
found f5db6319c6 in https://public-inbox.org/git/2442071fd0581a221802e348182ed04267ef3044.1597857412.git.gitgitgadget@gmail.com/ ||
	https://public-inbox.org/git/8a7c34035ac8a86c82dc2bdeee8a9a76fc5626ed.1598380805.git.gitgitgadget@gmail.com/ ||
	https://public-inbox.org/git/e9672c6a6c9ea2f9f42cf599f1726978d9629b71.1598629517.git.gitgitgadget@gmail.com/ ||
	https://public-inbox.org/git/e02641881d998d1e6a31e941b61eb6f89d0519f7.1599234127.git.gitgitgadget@gmail.com/

applying [1/1] https://public-inbox.org/git/2442071fd0581a221802e348182ed04267ef3044.1597857412.git.gitgitgadget@gmail.com/
diff --git a/t/helper/test-crontab.c b/t/helper/test-crontab.c
new file mode 100644
index 0000000000..f5db6319c6

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

skipping https://public-inbox.org/git/8a7c34035ac8a86c82dc2bdeee8a9a76fc5626ed.1598380805.git.gitgitgadget@gmail.com/ for f5db6319c6
skipping https://public-inbox.org/git/e9672c6a6c9ea2f9f42cf599f1726978d9629b71.1598629517.git.gitgitgadget@gmail.com/ for f5db6319c6
skipping https://public-inbox.org/git/e02641881d998d1e6a31e941b61eb6f89d0519f7.1599234127.git.gitgitgadget@gmail.com/ for f5db6319c6
index at:
100644 f5db6319c65ecbf4a08a0abeb504978da48b70c1	t/helper/test-crontab.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).