Skip to content

Commit a25606c

Browse files
jeffhostetlerderrickstolee
authored andcommitted
status: disable deserialize when verbose output requested.
Disable deserialization when verbose output requested. Verbose mode causes Git to print diffs for modified files. This requires the index to be loaded to have the currently staged OID values. Without loading the index, verbose output make it look like everything was deleted. Signed-off-by: Jeff Hostetler <[email protected]>
1 parent a0876d8 commit a25606c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

builtin/commit.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,6 +1595,22 @@ int cmd_status(int argc, const char **argv, const char *prefix)
15951595
*/
15961596
try_deserialize = (!do_serialize &&
15971597
(do_implicit_deserialize || do_explicit_deserialize));
1598+
1599+
/*
1600+
* Disable deserialize when verbose is set because it causes us to
1601+
* print diffs for each modified file, but that requires us to have
1602+
* the index loaded and we don't want to do that (at least not now for
1603+
* this seldom used feature). My fear is that would further tangle
1604+
* the merge conflict with upstream.
1605+
*
1606+
* TODO Reconsider this in the future.
1607+
*/
1608+
if (try_deserialize && verbose) {
1609+
trace2_data_string("status", the_repository, "deserialize/reject",
1610+
"args/verbose");
1611+
try_deserialize = 0;
1612+
}
1613+
15981614
if (try_deserialize)
15991615
goto skip_init;
16001616

0 commit comments

Comments
 (0)