summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d616a23)
raw | patch | inline | side by side (parent: d616a23)
author | Junio C Hamano <gitster@pobox.com> | |
Sun, 23 Dec 2007 03:25:37 +0000 (19:25 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 23 Dec 2007 03:45:06 +0000 (19:45 -0800) |
The flag no_edit meant "we have got final message from the user
and will not editing it any further", but there were quite a few
places that needed to check !no_edit. Rename the variable to
use_editor and reverse the logic everywhere.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
and will not editing it any further", but there were quite a few
places that needed to check !no_edit. Rename the variable to
use_editor and reverse the logic everywhere.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-commit.c | patch | blob | history |
diff --git a/builtin-commit.c b/builtin-commit.c
index eebd4cf066852e5113d2dc339f7853a3f3752f30..1d544cbe358c6390a00be8e0c1ed56306f8a5176 100644 (file)
--- a/builtin-commit.c
+++ b/builtin-commit.c
static int all, edit_flag, also, interactive, only, amend, signoff;
static int quiet, verbose, untracked_files, no_verify, allow_empty;
-static int no_edit, initial_commit, in_merge;
+static int use_editor = 1, initial_commit, in_merge;
const char *only_include_assumed;
struct strbuf message;
strbuf_release(&sb);
- if (no_edit) {
+ if (!use_editor) {
struct rev_info rev;
unsigned char sha1[20];
const char *parent = "HEAD";
return !!DIFF_OPT_TST(&rev.diffopt, HAS_CHANGES);
}
- if (in_merge && !no_edit)
+ if (in_merge)
fprintf(fp,
"#\n"
"# It looks like you may be committing a MERGE.\n"
argc = parse_options(argc, argv, builtin_commit_options, usage, 0);
if (logfile || message.len || use_message)
- no_edit = 1;
+ use_editor = 0;
if (edit_flag)
- no_edit = 0;
+ use_editor = 1;
if (get_sha1("HEAD", head_sha1))
initial_commit = 1;
/* Get the commit message and validate it */
header_len = sb.len;
- if (!no_edit) {
+ if (use_editor) {
char index[PATH_MAX];
const char *env[2] = { index, NULL };
snprintf(index, sizeof(index), "GIT_INDEX_FILE=%s", index_file);