git-add: Make the "tried to add ignored file" error message less confusing
Currently the error message seems to imply (at least to me) that only the listed files were withheld and the rest of the files was added to the index, even though that's obviously not the case. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Petr Baudis committed
Aug 29, 2007 at 00:41 UTC
b39c53e662b97108ee1bda72076630d9d0e56211
1 file changed
+3
-3
builtin-add.c
+3
-3
@@ -155,7 +155,7 @@ static int git_add_config(const char *var, const char *value)
155
156
static struct lock_file lock_file;
157
158
-static const char ignore_warning[] =
158
+static const char ignore_error[] =
159
"The following paths are ignored by one of your .gitignore files:\n";
160
161
int cmd_add(int argc, const char **argv, const char *prefix)
@@ -250,12 +250,12 @@ int cmd_add(int argc, const char **argv, const char *prefix)
250
die("index file corrupt");
251
252
if (dir.ignored_nr) {
253
- fprintf(stderr, ignore_warning);
253
+ fprintf(stderr, ignore_error);
254
for (i = 0; i < dir.ignored_nr; i++) {
255
fprintf(stderr, "%s\n", dir.ignored[i]->name);
256
}
257
fprintf(stderr, "Use -f if you really want to add them.\n");
258
- exit(1);
258
+ die("no files added");
259
}
260
261
for (i = 0; i < dir.nr; i++)