fmt-merge-msg fix
The new C version mistranslated the original Perl version in the case to pull from the HEAD. This made it to say nonsense like this: Merge commit ...url... of HEAD * HEAD: ... Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
e130ddaaf3
commit
e918c6abac
@ -76,6 +76,7 @@ static int handle_line(char *line)
|
|||||||
unsigned char *sha1;
|
unsigned char *sha1;
|
||||||
char *src, *origin;
|
char *src, *origin;
|
||||||
struct src_data *src_data;
|
struct src_data *src_data;
|
||||||
|
int pulling_head = 0;
|
||||||
|
|
||||||
if (len < 43 || line[40] != '\t')
|
if (len < 43 || line[40] != '\t')
|
||||||
return 1;
|
return 1;
|
||||||
@ -101,8 +102,11 @@ static int handle_line(char *line)
|
|||||||
if (src) {
|
if (src) {
|
||||||
*src = 0;
|
*src = 0;
|
||||||
src += 4;
|
src += 4;
|
||||||
} else
|
pulling_head = 0;
|
||||||
src = "HEAD";
|
} else {
|
||||||
|
src = line;
|
||||||
|
pulling_head = 1;
|
||||||
|
}
|
||||||
|
|
||||||
i = find_in_list(&srcs, src);
|
i = find_in_list(&srcs, src);
|
||||||
if (i < 0) {
|
if (i < 0) {
|
||||||
@ -112,7 +116,10 @@ static int handle_line(char *line)
|
|||||||
}
|
}
|
||||||
src_data = srcs.payload[i];
|
src_data = srcs.payload[i];
|
||||||
|
|
||||||
if (!strncmp(line, "branch ", 7)) {
|
if (pulling_head) {
|
||||||
|
origin = strdup(src);
|
||||||
|
src_data->head_status |= 1;
|
||||||
|
} else if (!strncmp(line, "branch ", 7)) {
|
||||||
origin = strdup(line + 7);
|
origin = strdup(line + 7);
|
||||||
append_to_list(&src_data->branch, origin, NULL);
|
append_to_list(&src_data->branch, origin, NULL);
|
||||||
src_data->head_status |= 2;
|
src_data->head_status |= 2;
|
||||||
@ -124,9 +131,6 @@ static int handle_line(char *line)
|
|||||||
origin = strdup(line + 14);
|
origin = strdup(line + 14);
|
||||||
append_to_list(&src_data->r_branch, origin, NULL);
|
append_to_list(&src_data->r_branch, origin, NULL);
|
||||||
src_data->head_status |= 2;
|
src_data->head_status |= 2;
|
||||||
} else if (!strcmp(line, "HEAD")) {
|
|
||||||
origin = strdup(src);
|
|
||||||
src_data->head_status |= 1;
|
|
||||||
} else {
|
} else {
|
||||||
origin = strdup(src);
|
origin = strdup(src);
|
||||||
append_to_list(&src_data->generic, strdup(line), NULL);
|
append_to_list(&src_data->generic, strdup(line), NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user