summaryrefslogtreecommitdiff
path: root/builtin-commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-08-15 09:27:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-08-22 19:18:00 (GMT)
commit9e4b7ab652561e1807702fe5288e04b8873fc437 (patch)
tree468f28135714375fa664bfebf4a0fa0f71582d54 /builtin-commit.c
parent173e6c8852be3c543689f8613ddf3fdafd9ca7b9 (diff)
downloadgit-9e4b7ab652561e1807702fe5288e04b8873fc437.zip
git-9e4b7ab652561e1807702fe5288e04b8873fc437.tar.gz
git-9e4b7ab652561e1807702fe5288e04b8873fc437.tar.bz2
git status: not "commit --dry-run" anymore
This removes tentative "git stat" and make it take over "git status". There are some tests that expect "git status" to exit with non-zero status when there is something staged. Some tests expect "git status path..." to show the status for a partial commit. For these, replace "git status" with "git commit --dry-run". For the ones that do not attempt a dry-run of a partial commit that check the output from the command, check the output from "git status" as well, as they should be identical. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-commit.c')
-rw-r--r--builtin-commit.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/builtin-commit.c b/builtin-commit.c
index 1a360cb..6cb0e40 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -36,11 +36,6 @@ static const char * const builtin_status_usage[] = {
NULL
};
-static const char * const builtin_stat_usage[] = {
- "git stat [options]",
- NULL
-};
-
static unsigned char head_sha1[20], merge_head_sha1[20];
static char *use_message_buffer;
static const char commit_editmsg[] = "COMMIT_EDITMSG";
@@ -971,13 +966,13 @@ static void short_untracked(int null_termination, struct string_list_item *it,
}
}
-int cmd_stat(int argc, const char **argv, const char *prefix)
+int cmd_status(int argc, const char **argv, const char *prefix)
{
struct wt_status s;
static int null_termination, shortstatus;
int i;
unsigned char sha1[20];
- static struct option builtin_stat_options[] = {
+ static struct option builtin_status_options[] = {
OPT__VERBOSE(&verbose),
OPT_BOOLEAN('s', "short", &shortstatus,
"show status concicely"),
@@ -996,8 +991,8 @@ int cmd_stat(int argc, const char **argv, const char *prefix)
wt_status_prepare(&s);
git_config(git_status_config, &s);
argc = parse_options(argc, argv, prefix,
- builtin_stat_options,
- builtin_stat_usage, 0);
+ builtin_status_options,
+ builtin_status_usage, 0);
handle_untracked_files_arg(&s);
if (*argv)
@@ -1039,22 +1034,6 @@ int cmd_stat(int argc, const char **argv, const char *prefix)
return 0;
}
-int cmd_status(int argc, const char **argv, const char *prefix)
-{
- struct wt_status s;
-
- wt_status_prepare(&s);
- git_config(git_status_config, &s);
- if (s.use_color == -1)
- s.use_color = git_use_color_default;
- if (diff_use_color_default == -1)
- diff_use_color_default = git_use_color_default;
-
- argc = parse_and_validate_options(argc, argv, builtin_status_usage,
- prefix, &s);
- return dry_run_commit(argc, argv, prefix, &s);
-}
-
static void print_summary(const char *prefix, const unsigned char *sha1)
{
struct rev_info rev;