Git Mailing List Archive mirror
 help / color / mirror / code / Atom feed
blob e4c3e8f01c3df56d922005380d991a55b23620ac 901 bytes (raw)
name: t/helper/test-read-cache.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
 
#define USE_THE_INDEX_VARIABLE
#include "test-tool.h"
#include "cache.h"
#include "config.h"
#include "setup.h"

int cmd__read_cache(int argc, const char **argv)
{
	int i, cnt = 1;
	const char *name = NULL;

	initialize_the_repository();

	if (argc > 1 && skip_prefix(argv[1], "--print-and-refresh=", &name)) {
		argc--;
		argv++;
	}

	if (argc == 2)
		cnt = strtol(argv[1], NULL, 0);
	setup_git_directory();
	git_config(git_default_config, NULL);

	for (i = 0; i < cnt; i++) {
		repo_read_index(the_repository);
		if (name) {
			int pos;

			refresh_index(&the_index, REFRESH_QUIET,
				      NULL, NULL, NULL);
			pos = index_name_pos(&the_index, name, strlen(name));
			if (pos < 0)
				die("%s not in index", name);
			printf("%s is%s up to date\n", name,
			       ce_uptodate(the_index.cache[pos]) ? "" : " not");
			write_file(name, "%d\n", i);
		}
		discard_index(&the_index);
	}
	return 0;
}

debug log:

solving e4c3e8f01c ...
found e4c3e8f01c in https://80x24.org/lore/git/20230516170932.1358685-6-calvinwan@google.com/
found a4c24d0e42 in https://80x24.org/lore/pub/scm/git/git.git/
preparing index
index prepared:
100644 a4c24d0e4215f6bec167b61125bc8629bbc774a0	t/helper/test-read-cache.c

applying [1/1] https://80x24.org/lore/git/20230516170932.1358685-6-calvinwan@google.com/
diff --git a/t/helper/test-read-cache.c b/t/helper/test-read-cache.c
index a4c24d0e42..e4c3e8f01c 100644

Checking patch t/helper/test-read-cache.c...
Applied patch t/helper/test-read-cache.c cleanly.

index at:
100644 e4c3e8f01c3df56d922005380d991a55b23620ac	t/helper/test-read-cache.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/lore/pub/scm/git/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).