Skip to content

Commit 19a3a7b

Browse files
pks-tgitster
authored andcommitted
t/helper: allow chmtime to print verbosely without modifying mtime
The `test-tool chmtime` helper allows us to both read and modify the modification time of files. But while it is possible to only read the mtimes of a file via `--get`, it is not possible to read the mtimes and report them together with their respective file paths via the `--verbose` flag without also modifying the mtime at the same time. Fix this so that it is possible to call `test-tool chmtime --verbose <files>...` without modifying any mtimes. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f302841 commit 19a3a7b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/helper/test-chmtime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ int cmd__chmtime(int argc, const char **argv)
9494
if (timespec_arg(argv[i], &set_time, &set_eq)) {
9595
++i;
9696
} else {
97-
if (get == 0) {
97+
if (get == 0 && verbose == 0) {
9898
fprintf(stderr, "Not a base-10 integer: %s\n", argv[i] + 1);
9999
goto usage;
100100
}

0 commit comments

Comments
 (0)