Skip to content

Commit

Permalink
Merge branch 'sb/maint-1.6.0-add-config-fix' into maint
Browse files Browse the repository at this point in the history
* sb/maint-1.6.0-add-config-fix:
  add: allow configurations to be overriden by command line
  • Loading branch information
Junio C Hamano committed Jun 22, 2009
2 parents cff4231 + ed342fd commit d1f6c18
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions builtin-add.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,15 @@ int cmd_add(int argc, const char **argv, const char *prefix)
int add_new_files;
int require_pathspec;

git_config(add_config, NULL);

argc = parse_options(argc, argv, builtin_add_options,
builtin_add_usage, 0);
if (patch_interactive)
add_interactive = 1;
if (add_interactive)
exit(interactive_add(argc, argv, prefix));

git_config(add_config, NULL);

if (addremove && take_worktree_changes)
die("-A and -u are mutually incompatible");
if ((addremove || take_worktree_changes) && !argc) {
Expand Down
13 changes: 13 additions & 0 deletions t/t3700-add.sh
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,19 @@ test_expect_success POSIXPERM 'git add (add.ignore-errors = false)' '
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 BSLASHPSPEC "git add 'fo\\[ou\\]bar' ignores foobar" '
git reset --hard &&
Expand Down

0 comments on commit d1f6c18

Please sign in to comment.