summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 95b9f9f)
raw | patch | inline | side by side (parent: 95b9f9f)
author | Brandon Casey <drafnel@gmail.com> | |
Thu, 26 May 2011 20:43:21 +0000 (13:43 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 29 May 2011 20:00:10 +0000 (13:00 -0700) |
'git status' should use --porcelain output format when -z is given.
It was not doing so since the _effect_ of using -z, namely that
null_termination would be set, was being checked _before_ option parsing
was performed.
So, move the check so that it is performed after option parsing.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
It was not doing so since the _effect_ of using -z, namely that
null_termination would be set, was being checked _before_ option parsing
was performed.
So, move the check so that it is performed after option parsing.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-commit.c | patch | blob | history | |
t/t7508-status.sh | patch | blob | history |
diff --git a/builtin-commit.c b/builtin-commit.c
index f2fd0a4580820dc3d78681a7bcd3145dc94a0513..9e7208f729d9bb8405fd1a6bbbe8f5081db0c497 100644 (file)
--- a/builtin-commit.c
+++ b/builtin-commit.c
OPT_END(),
};
- if (null_termination && status_format == STATUS_FORMAT_LONG)
- status_format = STATUS_FORMAT_PORCELAIN;
-
wt_status_prepare(&s);
git_config(git_status_config, &s);
argc = parse_options(argc, argv, prefix,
builtin_status_options,
builtin_status_usage, 0);
+
+ if (null_termination && status_format == STATUS_FORMAT_LONG)
+ status_format = STATUS_FORMAT_PORCELAIN;
+
handle_untracked_files_arg(&s);
if (*argv)
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index 9bc9817f289385dd0e2338313d6b7cbcd4125b5a..d4844abf13cd37ec6947fe29355ea8e2302b964b 100755 (executable)
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
test_cmp expect output
'
-test_expect_failure 'status -z implies porcelain' '
+test_expect_success 'status -z implies porcelain' '
git status --porcelain |
perl -pe "s/\012/\000/g" >expect &&
git status -z >output &&