Merge branch 'jk/skip-prefix'
* jk/skip-prefix: http-push: refactor parsing of remote object names imap-send: use skip_prefix instead of using magic numbers use skip_prefix to avoid repeated calculations git: avoid magic number with skip_prefix fetch-pack: refactor parsing in get_ack fast-import: refactor parsing of spaces stat_opt: check extra strlen call daemon: use skip_prefix to avoid magic numbers fast-import: use skip_prefix for parsing input use skip_prefix to avoid repeating strings use skip_prefix to avoid magic numbers transport-helper: avoid reading past end-of-string fast-import: fix read of uninitialized argv memory apply: use skip_prefix instead of raw addition refactor skip_prefix to return a boolean avoid using skip_prefix as a boolean daemon: mark some strings as const parse_diff_color_slot: drop ofs parameter
This commit is contained in:
@ -100,7 +100,8 @@ static int handle_line(char *line, struct merge_parents *merge_parents)
|
||||
{
|
||||
int i, len = strlen(line);
|
||||
struct origin_data *origin_data;
|
||||
char *src, *origin;
|
||||
char *src;
|
||||
const char *origin;
|
||||
struct src_data *src_data;
|
||||
struct string_list_item *item;
|
||||
int pulling_head = 0;
|
||||
@ -164,8 +165,7 @@ static int handle_line(char *line, struct merge_parents *merge_parents)
|
||||
origin = line;
|
||||
string_list_append(&src_data->tag, origin + 4);
|
||||
src_data->head_status |= 2;
|
||||
} else if (starts_with(line, "remote-tracking branch ")) {
|
||||
origin = line + strlen("remote-tracking branch ");
|
||||
} else if (skip_prefix(line, "remote-tracking branch ", &origin)) {
|
||||
string_list_append(&src_data->r_branch, origin);
|
||||
src_data->head_status |= 2;
|
||||
} else {
|
||||
@ -300,8 +300,8 @@ static void credit_people(struct strbuf *out,
|
||||
if (!them->nr ||
|
||||
(them->nr == 1 &&
|
||||
me &&
|
||||
(me = skip_prefix(me, them->items->string)) != NULL &&
|
||||
skip_prefix(me, " <")))
|
||||
skip_prefix(me, them->items->string, &me) &&
|
||||
starts_with(me, " <")))
|
||||
return;
|
||||
strbuf_addf(out, "\n%c %s ", comment_line_char, label);
|
||||
add_people_count(out, them);
|
||||
|
||||
Reference in New Issue
Block a user