Skip to content

Commit e3733b6

Browse files
rscharfegitster
authored andcommitted
archive: deduplicate verbose printing
94bc671 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 359da65 commit e3733b6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

archive.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,18 +165,16 @@ static int write_archive_entry(const struct object_id *oid, const char *base,
165165
args->convert = check_attr_export_subst(check);
166166
}
167167

168+
if (args->verbose)
169+
fprintf(stderr, "%.*s\n", (int)path.len, path.buf);
170+
168171
if (S_ISDIR(mode) || S_ISGITLINK(mode)) {
169-
if (args->verbose)
170-
fprintf(stderr, "%.*s\n", (int)path.len, path.buf);
171172
err = write_entry(args, oid, path.buf, path.len, mode, NULL, 0);
172173
if (err)
173174
return err;
174175
return (S_ISDIR(mode) ? READ_TREE_RECURSIVE : 0);
175176
}
176177

177-
if (args->verbose)
178-
fprintf(stderr, "%.*s\n", (int)path.len, path.buf);
179-
180178
/* Stream it? */
181179
if (S_ISREG(mode) && !args->convert &&
182180
oid_object_info(args->repo, oid, &size) == OBJ_BLOB &&

0 commit comments

Comments
 (0)