Skip to content

Commit 66e41f7

Browse files
committed
Avoid diff cost on "git log -z"
Johannes and Marco discovered that "git log -z" spent cycles in diff even though there is no need to actually compute diffs. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7b99bef commit 66e41f7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

revision.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
11711171

11721172
opts = diff_opt_parse(&revs->diffopt, argv+i, argc-i);
11731173
if (opts > 0) {
1174-
revs->diff = 1;
1174+
if (strcmp(argv[i], "-z"))
1175+
revs->diff = 1;
11751176
i += opts - 1;
11761177
continue;
11771178
}

0 commit comments

Comments
 (0)