aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-12-16 22:33:56 -0800
committerJunio C Hamano <gitster@pobox.com>2011-12-16 22:33:56 -0800
commita2add8570c90e14e8e0cedae935091f100c758dc (patch)
tree7284b2dba483b9443af76c5c2ad030b6b295a7eb /builtin
parent48b303675aa238c209e527feadcbb7ba1c025c97 (diff)
parentbc8218999863a083d725f2011e5e0371df30aa1f (diff)
downloadgit-a2add8570c90e14e8e0cedae935091f100c758dc.tar.gz
git-a2add8570c90e14e8e0cedae935091f100c758dc.tar.xz
Merge branch 'jc/commit-amend-no-edit'
* jc/commit-amend-no-edit: test: commit --amend should honor --no-edit commit: honour --no-edit t7501 (commit): modernize style test: remove a porcelain test that hard-codes commit names test: add missing "&&" after echo command
Diffstat (limited to 'builtin')
-rw-r--r--builtin/commit.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index e36e9adf8..f73ef9c86 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -81,7 +81,8 @@ static const char *template_file;
static const char *author_message, *author_message_buffer;
static char *edit_message, *use_message;
static char *fixup_message, *squash_message;
-static int all, edit_flag, also, interactive, patch_interactive, only, amend, signoff;
+static int all, also, interactive, patch_interactive, only, amend, signoff;
+static int edit_flag = -1; /* unspecified */
static int quiet, verbose, no_verify, allow_empty, dry_run, renew_authorship;
static int no_post_rewrite, allow_empty_message;
static char *untracked_files_arg, *force_date, *ignore_submodule_arg;
@@ -141,7 +142,7 @@ static struct option builtin_commit_options[] = {
OPT_BOOLEAN(0, "reset-author", &renew_authorship, "the commit is authored by me now (used with -C-c/--amend)"),
OPT_BOOLEAN('s', "signoff", &signoff, "add Signed-off-by:"),
OPT_FILENAME('t', "template", &template_file, "use specified template file"),
- OPT_BOOLEAN('e', "edit", &edit_flag, "force edit of commit"),
+ OPT_BOOL('e', "edit", &edit_flag, "force edit of commit"),
OPT_STRING(0, "cleanup", &cleanup_arg, "default", "how to strip spaces and #comments from message"),
OPT_BOOLEAN(0, "status", &include_status, "include status in commit message template"),
/* end commit message options */
@@ -1020,8 +1021,8 @@ static int parse_and_validate_options(int argc, const char *argv[],
if (logfile || message.len || use_message || fixup_message)
use_editor = 0;
- if (edit_flag)
- use_editor = 1;
+ if (0 <= edit_flag)
+ use_editor = edit_flag;
if (!use_editor)
setenv("GIT_EDITOR", ":", 1);