Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-07-17 21:30:41 +0300
committerJunio C Hamano <gitster@pobox.com>2023-07-17 21:30:41 +0300
commitd383b4f24e29a4654276d54f8ba9102230342c09 (patch)
treed525ebbb64b973a648d567d9576e36fd895be6c8 /pretty.c
parent55e8fad660e52df2be425a65d409226237fcff48 (diff)
parentbd19ee9c459b2d7872a8e486fd9c2f1b17d662a5 (diff)
Merge branch 'rs/userformat-find-requirements-simplify'
Code simplification. * rs/userformat-find-requirements-simplify: pretty: use strchr(3) in userformat_find_requirements()
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/pretty.c b/pretty.c
index 81cdc9f2cd..82f30e27c5 100644
--- a/pretty.c
+++ b/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)
{
- struct strbuf dummy = STRBUF_INIT;
-
if (!fmt) {
if (!user_format)
return;
fmt = user_format;
}
- while (strbuf_expand_step(&dummy, &fmt)) {
+ while ((fmt = strchr(fmt, '%'))) {
+ fmt++;
if (skip_prefix(fmt, "%", &fmt))
continue;
@@ -1903,7 +1902,6 @@ void userformat_find_requirements(const char *fmt, struct userformat_want *w)
break;
}
}
- strbuf_release(&dummy);
}
void repo_format_commit_message(struct repository *r,