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:
authorRené Scharfe <l.s.r@web.de>2022-10-11 12:29:38 +0300
committerJunio C Hamano <gitster@pobox.com>2022-10-11 18:35:10 +0300
commite3733b646dcec33947aa4658c0ed89a8a4b42c4b (patch)
treec42e83c32236639f000e5523f2bbb4f032947c96 /archive.c
parent359da658ae32d9a7e5e93ac173fc221352b62917 (diff)
archive: deduplicate verbose printing
94bc671a1f (Add directory pattern matching to attributes, 2012-12-08) moved the code for adding the trailing slash to names of directories and submodules up. This left both branches of the if statement starting with the same conditional fprintf call. Deduplicate it. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'archive.c')
-rw-r--r--archive.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/archive.c b/archive.c
index d571249cf3..ec0ed75809 100644
--- a/archive.c
+++ b/archive.c
@@ -165,18 +165,16 @@ static int write_archive_entry(const struct object_id *oid, const char *base,
args->convert = check_attr_export_subst(check);
}
+ if (args->verbose)
+ fprintf(stderr, "%.*s\n", (int)path.len, path.buf);
+
if (S_ISDIR(mode) || S_ISGITLINK(mode)) {
- if (args->verbose)
- fprintf(stderr, "%.*s\n", (int)path.len, path.buf);
err = write_entry(args, oid, path.buf, path.len, mode, NULL, 0);
if (err)
return err;
return (S_ISDIR(mode) ? READ_TREE_RECURSIVE : 0);
}
- if (args->verbose)
- fprintf(stderr, "%.*s\n", (int)path.len, path.buf);
-
/* Stream it? */
if (S_ISREG(mode) && !args->convert &&
oid_object_info(args->repo, oid, &size) == OBJ_BLOB &&