Skip to content

Commit

Permalink
git commit --dry-run -v: show diff in color when asked
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Aug 15, 2009
1 parent 60c2993 commit 3fa509d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions builtin-commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,9 +979,11 @@ int cmd_commit(int argc, const char **argv, const char *prefix)

argc = parse_and_validate_options(argc, argv, builtin_commit_usage,
prefix, &s);
if (dry_run)
if (dry_run) {
if (diff_use_color_default == -1)
diff_use_color_default = git_use_color_default;
return dry_run_commit(argc, argv, prefix, &s);

}
index_file = prepare_index(argc, argv, prefix, 0);

/* Set up everything for writing the commit object. This includes
Expand Down

0 comments on commit 3fa509d

Please sign in to comment.