X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-commit.c;h=46e649cd7ca0a2ede8f010a6d3bf294f81b85d55;hb=45e2b6140147d7a8b2cd68399e4d52d5d8d7b5be;hp=d6a3a6203aee399218c89d31ff5cb28f16dc0cc6;hpb=ed096c4a23476810831e12d2e9227403c21bd774;p=git.git diff --git a/builtin-commit.c b/builtin-commit.c index d6a3a6203..46e649cd7 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -561,7 +561,6 @@ static int prepare_to_commit(const char *index_file, const char *prefix) commitable = run_status(fp, index_file, prefix, 1); wt_status_use_color = saved_color_setting; } else { - struct rev_info rev; unsigned char sha1[20]; const char *parent = "HEAD"; @@ -573,16 +572,8 @@ static int prepare_to_commit(const char *index_file, const char *prefix) if (get_sha1(parent, sha1)) commitable = !!active_nr; - else { - init_revisions(&rev, ""); - rev.abbrev = 0; - setup_revisions(0, NULL, &rev, parent); - DIFF_OPT_SET(&rev.diffopt, QUIET); - DIFF_OPT_SET(&rev.diffopt, EXIT_WITH_STATUS); - run_diff_index(&rev, 1 /* cached */); - - commitable = !!DIFF_OPT_TST(&rev.diffopt, HAS_CHANGES); - } + else + commitable = index_differs_from(parent, 0); } fclose(fp);