From: Junio C Hamano Date: Wed, 8 Dec 2010 19:25:52 +0000 (-0800) Subject: Merge branch 'nd/maint-fix-add-typo-detection' (early part) X-Git-Tag: v1.7.4-rc0~73 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/f80b6de4eca9c4c4abfe9407736311de27726e53?hp=-c Merge branch 'nd/maint-fix-add-typo-detection' (early part) * 'nd/maint-fix-add-typo-detection' (early part): add: do not rely on dtype being NULL behavior --- f80b6de4eca9c4c4abfe9407736311de27726e53 diff --combined builtin/add.c index 21dc1f7339,1a4672d121..12b964e642 --- a/builtin/add.c +++ b/builtin/add.c @@@ -313,13 -313,13 +313,13 @@@ static int verbose = 0, show_only = 0, 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"), @@@ -331,8 -331,7 +331,8 @@@ 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; } @@@ -447,7 -446,8 +447,8 @@@ int cmd_add(int argc, const char **argv 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",