author | Jeff King <peff@peff.net> | |
Mon, 7 Dec 2009 05:26:25 +0000 (00:26 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 7 Dec 2009 08:41:14 +0000 (00:41 -0800) | ||
commit | 8661768fc9cfdeeaae76693501b82940cfcbedc2 | |
tree | 959b9d978f0f4bab17d73a1e95d396f728ac7b78 | tree | snapshot |
parent | 4a7cc2fdf39c90e6eff84d30b86490cac2c33705 | commit | diff |
status: reduce duplicated setup code
We have three output formats: short, porcelain, and long.
The short and long formats respect user-config, and the
porcelain one does not. This led to us repeating
config-related setup code for the short and long formats.
Since the last commit, color config is explicitly cleared
when showing the porcelain format. Let's do the same with
relative-path configuration, which enables us to hoist the
duplicated code from the switch statement in cmd_status.
As a bonus, this fixes "commit --dry-run --porcelain", which
was unconditionally setting up that configuration, anyway.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
We have three output formats: short, porcelain, and long.
The short and long formats respect user-config, and the
porcelain one does not. This led to us repeating
config-related setup code for the short and long formats.
Since the last commit, color config is explicitly cleared
when showing the porcelain format. Let's do the same with
relative-path configuration, which enables us to hoist the
duplicated code from the switch statement in cmd_status.
As a bonus, this fixes "commit --dry-run --porcelain", which
was unconditionally setting up that configuration, anyway.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-commit.c | diff | blob | history | |
wt-status.c | diff | blob | history |