author | Junio C Hamano <gitster@pobox.com> | |
Sun, 21 Jun 2009 04:46:38 +0000 (21:46 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 21 Jun 2009 04:46:38 +0000 (21:46 -0700) |
* 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
add: allow configurations to be overriden by command line
use xstrdup, not strdup in ll-merge.c
Conflicts:
builtin-add.c
1 | 2 | |||
---|---|---|---|---|
builtin-add.c | patch | | diff1 | | diff2 | | blob | history |
ll-merge.c | patch | | diff1 | | diff2 | | blob | history |
t/t3700-add.sh | patch | | diff1 | | diff2 | | blob | history |
diff --cc builtin-add.c
index c1b229a9d8a026ec88cdbf0492856021cacc8097,13db4a6455e17a0f960e53ddcbc6e2db898f55d0..56e522127c3e73fad59d8dc96bdffdb87a3b7a44
--- 1/builtin-add.c
--- 2/builtin-add.c
+++ b/builtin-add.c
int add_new_files;
int require_pathspec;
- argc = parse_options(argc, argv, builtin_add_options,
- builtin_add_usage, 0);
+ git_config(add_config, NULL);
+
+ 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 ll-merge.c
Simple merge
diff --cc t/t3700-add.sh
index 6ce8256a17bb7c775eed301b3af8a88497a12c09,060a6ecabe4cf208dc88e4e4b1d42464c5f4d894..6ae5a2cd9511b83ad1d263c0ec0a374fc4bfc981
--- 1/t/t3700-add.sh
--- 2/t/t3700-add.sh
+++ b/t/t3700-add.sh
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'\'' &&