author | Junio C Hamano <gitster@pobox.com> | |
Wed, 8 Dec 2010 19:25:52 +0000 (11:25 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 8 Dec 2010 19:25:52 +0000 (11:25 -0800) |
* 'nd/maint-fix-add-typo-detection' (early part):
add: do not rely on dtype being NULL behavior
add: do not rely on dtype being NULL behavior
1 | 2 | |||
---|---|---|---|---|
builtin/add.c | patch | | diff1 | | diff2 | | blob | history |
diff --combined builtin/add.c
index 21dc1f73395b5f6b1491c235f656bea057092eb1,1a4672d121975504eed44c53865062d4161f542e..12b964e642b91863776f161a7b2aab2ec216efcb
--- 1/builtin/add.c
--- 2/builtin/add.c
+++ b/builtin/add.c
static int ignore_add_errors, addremove, intent_to_add, ignore_missing = 0;
static struct option builtin_add_options[] = {
- OPT__DRY_RUN(&show_only),
- OPT__VERBOSE(&verbose),
+ OPT__DRY_RUN(&show_only, "dry run"),
+ OPT__VERBOSE(&verbose, "be verbose"),
OPT_GROUP(""),
OPT_BOOLEAN('i', "interactive", &add_interactive, "interactive picking"),
OPT_BOOLEAN('p', "patch", &patch_interactive, "interactive patching"),
OPT_BOOLEAN('e', "edit", &edit_interactive, "edit current diff and apply"),
- OPT_BOOLEAN('f', "force", &ignored_too, "allow adding otherwise ignored files"),
+ OPT__FORCE(&ignored_too, "allow adding otherwise ignored files"),
OPT_BOOLEAN('u', "update", &take_worktree_changes, "update tracked files"),
OPT_BOOLEAN('N', "intent-to-add", &intent_to_add, "record only the fact that the path will be added later"),
OPT_BOOLEAN('A', "all", &addremove, "add all, noticing removal of tracked files"),
static int add_config(const char *var, const char *value, void *cb)
{
- if (!strcasecmp(var, "add.ignore-errors")) {
+ if (!strcasecmp(var, "add.ignoreerrors") ||
+ !strcasecmp(var, "add.ignore-errors")) {
ignore_add_errors = git_config_bool(var, value);
return 0;
}
if (!seen[i] && pathspec[i][0]
&& !file_exists(pathspec[i])) {
if (ignore_missing) {
- if (excluded(&dir, pathspec[i], DT_UNKNOWN))
+ int dtype = DT_UNKNOWN;
+ if (excluded(&dir, pathspec[i], &dtype))
dir_add_ignored(&dir, pathspec[i], strlen(pathspec[i]));
} else
die("pathspec '%s' did not match any files",