From: Junio C Hamano Date: Sun, 21 Jun 2009 04:46:38 +0000 (-0700) Subject: Merge branch 'sb/maint-1.6.0-add-config-fix' X-Git-Tag: v1.6.4-rc0~51 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=09236d80480c15f6da804e56a80c08d320475fb1;p=git.git Merge branch 'sb/maint-1.6.0-add-config-fix' * sb/maint-1.6.0-add-config-fix: add: allow configurations to be overriden by command line use xstrdup, not strdup in ll-merge.c Conflicts: builtin-add.c --- 09236d80480c15f6da804e56a80c08d320475fb1 diff --cc builtin-add.c index c1b229a9d,13db4a645..56e522127 --- a/builtin-add.c +++ b/builtin-add.c @@@ -298,19 -247,14 +298,19 @@@ int cmd_add(int argc, const char **argv int add_new_files; int require_pathspec; + git_config(add_config, NULL); + - argc = parse_options(argc, argv, builtin_add_options, - builtin_add_usage, 0); + argc = parse_options(argc, argv, prefix, builtin_add_options, + builtin_add_usage, PARSE_OPT_KEEP_ARGV0); if (patch_interactive) add_interactive = 1; if (add_interactive) - exit(interactive_add(argc, argv, prefix)); + exit(interactive_add(argc - 1, argv + 1, prefix)); + - git_config(add_config, NULL); - + if (edit_interactive) + return(edit_patch(argc, argv, prefix)); + argc--; + argv++; if (addremove && take_worktree_changes) die("-A and -u are mutually incompatible"); diff --cc t/t3700-add.sh index 6ce8256a1,060a6ecab..6ae5a2cd9 --- a/t/t3700-add.sh +++ b/t/t3700-add.sh @@@ -221,8 -221,21 +221,21 @@@ test_expect_success POSIXPERM 'git add test_must_fail git add --verbose . && ! ( git ls-files foo1 | grep foo1 ) ' + rm -f foo2 + + test_expect_success '--no-ignore-errors overrides config' ' + git config add.ignore-errors 1 && + git reset --hard && + date >foo1 && + date >foo2 && + chmod 0 foo2 && + test_must_fail git add --verbose --no-ignore-errors . && + ! ( git ls-files foo1 | grep foo1 ) && + git config add.ignore-errors 0 + ' + rm -f foo2 -test_expect_success 'git add '\''fo\[ou\]bar'\'' ignores foobar' ' +test_expect_success BSLASHPSPEC "git add 'fo\\[ou\\]bar' ignores foobar" ' git reset --hard && touch fo\[ou\]bar foobar && git add '\''fo\[ou\]bar'\'' &&