Merge branch 'rs/userformat-find-requirements-simplify' into next
Code simplification. * rs/userformat-find-requirements-simplify: pretty: use strchr(3) in userformat_find_requirements()
This commit is contained in:
6
pretty.c
6
pretty.c
@ -1876,14 +1876,13 @@ static size_t format_commit_item(struct strbuf *sb, /* in UTF-8 */
|
|||||||
|
|
||||||
void userformat_find_requirements(const char *fmt, struct userformat_want *w)
|
void userformat_find_requirements(const char *fmt, struct userformat_want *w)
|
||||||
{
|
{
|
||||||
struct strbuf dummy = STRBUF_INIT;
|
|
||||||
|
|
||||||
if (!fmt) {
|
if (!fmt) {
|
||||||
if (!user_format)
|
if (!user_format)
|
||||||
return;
|
return;
|
||||||
fmt = user_format;
|
fmt = user_format;
|
||||||
}
|
}
|
||||||
while (strbuf_expand_step(&dummy, &fmt)) {
|
while ((fmt = strchr(fmt, '%'))) {
|
||||||
|
fmt++;
|
||||||
if (skip_prefix(fmt, "%", &fmt))
|
if (skip_prefix(fmt, "%", &fmt))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -1903,7 +1902,6 @@ void userformat_find_requirements(const char *fmt, struct userformat_want *w)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
strbuf_release(&dummy);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void repo_format_commit_message(struct repository *r,
|
void repo_format_commit_message(struct repository *r,
|
||||||
|
Reference in New Issue
Block a user