summaryrefslogtreecommitdiff
path: root/wt-status.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2009-12-07 05:26:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-12-07 08:41:14 (GMT)
commit8661768fc9cfdeeaae76693501b82940cfcbedc2 (patch)
tree959b9d978f0f4bab17d73a1e95d396f728ac7b78 /wt-status.c
parent4a7cc2fdf39c90e6eff84d30b86490cac2c33705 (diff)
downloadgit-8661768fc9cfdeeaae76693501b82940cfcbedc2.zip
git-8661768fc9cfdeeaae76693501b82940cfcbedc2.tar.gz
git-8661768fc9cfdeeaae76693501b82940cfcbedc2.tar.bz2
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>
Diffstat (limited to 'wt-status.c')
-rw-r--r--wt-status.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/wt-status.c b/wt-status.c
index 756defe..3fdcf97 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -692,5 +692,7 @@ void wt_shortstatus_print(struct wt_status *s, int null_termination)
void wt_porcelain_print(struct wt_status *s, int null_termination)
{
s->use_color = 0;
+ s->relative_paths = 0;
+ s->prefix = NULL;
wt_shortstatus_print(s, null_termination);
}