git commit --dry-run -v: show diff in color when asked
The earlier implementation of --dry-run didn't duplicate the use of color "git status -v" set up for diff output. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Aug 15, 2009 at 02:14 UTC
3fa509dfbdb8526453f4213f79b371bdfa493f0e
1 file changed
+4
-2
builtin-commit.c
+4
-2
@@ -979,9 +979,11 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
979
980
argc = parse_and_validate_options(argc, argv, builtin_commit_usage,
981
prefix, &s);
982
- if (dry_run)
982
+ if (dry_run) {
983
+ if (diff_use_color_default == -1)
984
+ diff_use_color_default = git_use_color_default;
985
return dry_run_commit(argc, argv, prefix, &s);
984
-
986
+ }
987
index_file = prepare_index(argc, argv, prefix, 0);
988
989
/* Set up everything for writing the commit object. This includes