28
int add_errors;
29
const char *implicit_dot;
30
size_t implicit_dot_len;
31
-
32
- /* only needed for 2.0 transition preparation */
33
- int warn_add_would_remove;
31
};
32
33
static const char *option_with_implicit_dot;
93
return DIFF_STATUS_MODIFIED;
94
}
95
99
-static const char *add_would_remove_warning = N_(
100
- "You ran 'git add' with neither '-A (--all)' or '--ignore-removal',\n"
101
-"whose behaviour will change in Git 2.0 with respect to paths you removed.\n"
102
-"Paths like '%s' that are\n"
103
-"removed from your working tree are ignored with this version of Git.\n"
104
-"\n"
105
-"* 'git add --ignore-removal <pathspec>', which is the current default,\n"
106
-" ignores paths you removed from your working tree.\n"
107
-"\n"
108
-"* 'git add --all <pathspec>' will let you also record the removals.\n"
109
-"\n"
110
-"Run 'git status' to check the paths you removed from your working tree.\n");
111
-
112
-static void warn_add_would_remove(const char *path)
113
-{
114
- warning(_(add_would_remove_warning), path);
115
-}
116
-
96
static void update_callback(struct diff_queue_struct *q,
97
struct diff_options *opt, void *cbdata)
98
{
130
}
131
break;
132
case DIFF_STATUS_DELETED:
154
- if (data->warn_add_would_remove) {
155
- warn_add_would_remove(path);
156
- data->warn_add_would_remove = 0;
157
- }
133
if (data->flags & ADD_CACHE_IGNORE_REMOVAL)
134
break;
135
if (!(data->flags & ADD_CACHE_PRETEND))
353
static int verbose, show_only, ignored_too, refresh_only;
354
static int ignore_add_errors, intent_to_add, ignore_missing;
355
381
-#define ADDREMOVE_DEFAULT 0 /* Change to 1 in Git 2.0 */
356
+#define ADDREMOVE_DEFAULT 1
357
static int addremove = ADDREMOVE_DEFAULT;
358
static int addremove_explicit = -1; /* unspecified */
359
451
if (addremove && take_worktree_changes)
452
die(_("-A and -u are mutually incompatible"));
453
479
- /*
480
- * Warn when "git add pathspec..." was given without "-u" or "-A"
481
- * and pathspec... covers a removed path.
482
- */
483
- memset(&update_data, 0, sizeof(update_data));
484
- if (!take_worktree_changes && addremove_explicit < 0)
485
- update_data.warn_add_would_remove = 1;
486
-
454
if (!take_worktree_changes && addremove_explicit < 0 && argc)
488
- /*
489
- * Turn "git add pathspec..." to "git add -A pathspec..."
490
- * in Git 2.0 but not yet
491
- */
492
- ; /* addremove = 1; */
455
+ /* Turn "git add pathspec..." to "git add -A pathspec..." */
456
+ addremove = 1;
457
458
if (!show_only && ignore_missing)
459
die(_("Option --ignore-missing can only be used together with --dry-run"));
543
544
plug_bulk_checkin();
545
546
+ memset(&update_data, 0, sizeof(update_data));
547
if ((flags & ADD_CACHE_IMPLICIT_DOT) && prefix) {
548
/*
549
* Check for modified files throughout the worktree so