rerere: further de-dent do_plain_rerere()
It's just easier to follow this way. Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
8e7768b2de
commit
c7a25d3790
65
rerere.c
65
rerere.c
@ -682,42 +682,43 @@ static int do_plain_rerere(struct string_list *rr, int fd)
|
|||||||
* initial run would catch all and register their preimages.
|
* initial run would catch all and register their preimages.
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < conflict.nr; i++) {
|
for (i = 0; i < conflict.nr; i++) {
|
||||||
|
unsigned char sha1[20];
|
||||||
|
char *hex;
|
||||||
|
int ret;
|
||||||
const char *path = conflict.items[i].string;
|
const char *path = conflict.items[i].string;
|
||||||
if (!string_list_has_string(rr, path)) {
|
|
||||||
unsigned char sha1[20];
|
|
||||||
char *hex;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
/*
|
if (string_list_has_string(rr, path))
|
||||||
* Ask handle_file() to scan and assign a
|
continue;
|
||||||
* conflict ID. No need to write anything out
|
|
||||||
* yet.
|
|
||||||
*/
|
|
||||||
ret = handle_file(path, sha1, NULL);
|
|
||||||
if (ret < 1)
|
|
||||||
continue;
|
|
||||||
hex = xstrdup(sha1_to_hex(sha1));
|
|
||||||
string_list_insert(rr, path)->util = hex;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the directory does not exist, create
|
* Ask handle_file() to scan and assign a
|
||||||
* it. mkdir_in_gitdir() will fail with
|
* conflict ID. No need to write anything out
|
||||||
* EEXIST if there already is one.
|
* yet.
|
||||||
*
|
*/
|
||||||
* NEEDSWORK: make sure "gc" does not remove
|
ret = handle_file(path, sha1, NULL);
|
||||||
* preimage without removing the directory.
|
if (ret < 1)
|
||||||
*/
|
continue;
|
||||||
if (mkdir_in_gitdir(git_path("rr-cache/%s", hex)))
|
hex = xstrdup(sha1_to_hex(sha1));
|
||||||
continue;
|
string_list_insert(rr, path)->util = hex;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We are the first to encounter this
|
* If the directory does not exist, create
|
||||||
* conflict. Ask handle_file() to write the
|
* it. mkdir_in_gitdir() will fail with
|
||||||
* normalized contents to the "preimage" file.
|
* EEXIST if there already is one.
|
||||||
*/
|
*
|
||||||
handle_file(path, NULL, rerere_path(hex, "preimage"));
|
* NEEDSWORK: make sure "gc" does not remove
|
||||||
fprintf(stderr, "Recorded preimage for '%s'\n", path);
|
* preimage without removing the directory.
|
||||||
}
|
*/
|
||||||
|
if (mkdir_in_gitdir(git_path("rr-cache/%s", hex)))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We are the first to encounter this
|
||||||
|
* conflict. Ask handle_file() to write the
|
||||||
|
* normalized contents to the "preimage" file.
|
||||||
|
*/
|
||||||
|
handle_file(path, NULL, rerere_path(hex, "preimage"));
|
||||||
|
fprintf(stderr, "Recorded preimage for '%s'\n", path);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < rr->nr; i++)
|
for (i = 0; i < rr->nr; i++)
|
||||||
|
Loading…
Reference in New Issue
Block a user