diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-20 05:14:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-20 05:14:39 +0000 |
commit | 7260c37aa8c91c8008dcd2442a19c23d1c9040fb (patch) | |
tree | 83953428f11212a71a4616e535c1053076f9bb94 /builtin/ls-files.c | |
parent | Releasing progress-linux version 1:2.43.0-1~progress7.99u1. (diff) | |
download | git-7260c37aa8c91c8008dcd2442a19c23d1c9040fb.tar.xz git-7260c37aa8c91c8008dcd2442a19c23d1c9040fb.zip |
Merging upstream version 1:2.45.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'builtin/ls-files.c')
-rw-r--r-- | builtin/ls-files.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/builtin/ls-files.c b/builtin/ls-files.c index a0229c3..6eeb5cb 100644 --- a/builtin/ls-files.c +++ b/builtin/ls-files.c @@ -14,19 +14,15 @@ #include "gettext.h" #include "object-name.h" #include "strbuf.h" -#include "tree.h" -#include "cache-tree.h" #include "parse-options.h" #include "resolve-undo.h" #include "string-list.h" #include "path.h" #include "pathspec.h" #include "read-cache.h" -#include "run-command.h" #include "setup.h" #include "sparse-index.h" #include "submodule.h" -#include "submodule-config.h" #include "object-store.h" #include "hex.h" @@ -270,7 +266,6 @@ static void show_ce_fmt(struct repository *repo, const struct cache_entry *ce, struct strbuf sb = STRBUF_INIT; while (strbuf_expand_step(&sb, &format)) { - const char *end; size_t len; struct stat st; @@ -278,12 +273,6 @@ static void show_ce_fmt(struct repository *repo, const struct cache_entry *ce, strbuf_addch(&sb, '%'); else if ((len = strbuf_expand_literal(&sb, format))) format += len; - else if (*format != '(') - die(_("bad ls-files format: element '%s' " - "does not start with '('"), format); - else if (!(end = strchr(format + 1, ')'))) - die(_("bad ls-files format: element '%s' " - "does not end in ')'"), format); else if (skip_prefix(format, "(objectmode)", &format)) strbuf_addf(&sb, "%06o", ce->ce_mode); else if (skip_prefix(format, "(objectname)", &format)) @@ -312,8 +301,7 @@ static void show_ce_fmt(struct repository *repo, const struct cache_entry *ce, else if (skip_prefix(format, "(path)", &format)) write_name_to_buf(&sb, fullname); else - die(_("bad ls-files format: %%%.*s"), - (int)(end - format + 1), format); + strbuf_expand_bad_format(format, "ls-files"); } strbuf_addch(&sb, line_terminator); fwrite(sb.buf, sb.len, 1, stdout); |