Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> --- Documentation/config.txt | 9 --------- builtin/commit.c | 24 +----------------------- t/t2203-add-intent.sh | 2 +- 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index f9a05ac..abeb82b 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -831,15 +831,6 @@ commit.template:: "{tilde}/" is expanded to the value of `$HOME` and "{tilde}user/" to the specified user's home directory. -commit.ignoreIntentToAdd:: - Allow to commit the index as-is even if there are - intent-to-add entries (see option `-N` in linkgit:git-add[1]) - in index. Set to `false` to disallow commit in this acase, or `true` - to allow it. -+ -By default, `git commit` allows to commit as-is when you have intent-to-add -entries. Support for this configuration variable will be dropped in FIXME. - credential.helper:: Specify an external helper to be called when a username or password credential is needed; the helper may consult external diff --git a/builtin/commit.c b/builtin/commit.c index eb0ca49..491cae1 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -118,8 +118,6 @@ static enum { } status_format = STATUS_FORMAT_LONG; static int status_show_branch; -static int set_commit_ignoreintenttoadd; - static int opt_parse_m(const struct option *opt, const char *arg, int unset) { struct strbuf *buf = opt->value; @@ -423,18 +421,6 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, if (!pathspec || !*pathspec) { fd = hold_locked_index(&index_lock, 1); refresh_cache_or_die(refresh_flags); - if (!(cache_tree_flags & WRITE_TREE_IGNORE_INTENT_TO_ADD)) { - int i; - for (i = 0; i < active_nr; i++) - if (active_cache[i]->ce_flags & CE_INTENT_TO_ADD) - break; - if (i < active_nr) - warning(_("You are committing as-is with intent-to-add entries as the result of\n" - "\"git add -N\". Git currently forbids this case. But this is deprecated\n" - "support for this behavior will be dropped in FIXME.\n" - "Please look up document and set commit.ignoreIntentToAdd to true\n" - "or remove it.")); - } if (active_cache_changed) { update_main_cache_tree(cache_tree_flags | WRITE_TREE_SILENT); if (write_cache(fd, active_cache, active_nr) || @@ -1353,13 +1339,6 @@ static int git_commit_config(const char *k, const char *v, void *cb) include_status = git_config_bool(k, v); return 0; } - if (!strcmp(k, "commit.ignoreintenttoadd")) { - set_commit_ignoreintenttoadd = 1; - if (git_config_bool(k, v)) - cache_tree_flags |= WRITE_TREE_IGNORE_INTENT_TO_ADD; - else - cache_tree_flags &= ~WRITE_TREE_IGNORE_INTENT_TO_ADD; - } status = git_gpg_config(k, v, NULL); if (status) @@ -1423,8 +1402,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix) git_config(git_commit_config, &s); determine_whence(&s); - if (!set_commit_ignoreintenttoadd) - cache_tree_flags |= WRITE_TREE_IGNORE_INTENT_TO_ADD; + cache_tree_flags |= WRITE_TREE_IGNORE_INTENT_TO_ADD; if (get_sha1("HEAD", sha1)) current_head = NULL; diff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh index 09b8bbf..7c7ab54 100755 --- a/t/t2203-add-intent.sh +++ b/t/t2203-add-intent.sh @@ -50,7 +50,7 @@ test_expect_success 'can commit tree with i-t-a entry' ' echo frotz >nitfol && git add rezrov && git add -N nitfol && - git config commit.ignoreIntentToAdd true && + git config commit.ignoreIntentToAdd false && git commit -m initial && git ls-tree -r HEAD >actual && cat >expected <<EOF && -- 1.7.8.36.g69ee2 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html