summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e475fe1)
raw | patch | inline | side by side (parent: e475fe1)
author | Alex Riesen <raa.lkml@gmail.com> | |
Wed, 28 Nov 2007 21:13:08 +0000 (22:13 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 28 Nov 2007 22:03:59 +0000 (14:03 -0800) |
Like when it is already specified through -C, -F or -m to git-commit.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
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 a35881e20b2ba8a71a047a2a264e496ceb56ff05..1a9a2568815c3eaee5adbe2392a1969aa647f9f5 100644 (file)
--- a/builtin-commit.c
+++ b/builtin-commit.c
strbuf_release(&sb);
+ if (no_edit) {
+ struct rev_info rev;
+ unsigned char sha1[40];
+
+ fclose(fp);
+
+ if (!active_nr && read_cache() < 0)
+ die("Cannot read index");
+
+ if (get_sha1("HEAD", sha1) != 0)
+ return !!active_nr;
+
+ init_revisions(&rev, "");
+ rev.abbrev = 0;
+ setup_revisions(0, NULL, &rev, "HEAD");
+ DIFF_OPT_SET(&rev.diffopt, QUIET);
+ DIFF_OPT_SET(&rev.diffopt, EXIT_WITH_STATUS);
+ run_diff_index(&rev, 1 /* cached */);
+
+ return !!DIFF_OPT_TST(&rev.diffopt, HAS_CHANGES);
+ }
+
if (in_merge && !no_edit)
fprintf(fp,
"#\n"