Skip to content

Commit

Permalink
git-add: Make the "tried to add ignored file" error message less conf…
Browse files Browse the repository at this point in the history
…using

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>
  • Loading branch information
Petr Baudis authored and Junio C Hamano committed Aug 29, 2007
1 parent ce312af commit b39c53e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions builtin-add.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static int git_add_config(const char *var, const char *value)

static struct lock_file lock_file;

static const char ignore_warning[] =
static const char ignore_error[] =
"The following paths are ignored by one of your .gitignore files:\n";

int cmd_add(int argc, const char **argv, const char *prefix)
Expand Down Expand Up @@ -250,12 +250,12 @@ int cmd_add(int argc, const char **argv, const char *prefix)
die("index file corrupt");

if (dir.ignored_nr) {
fprintf(stderr, ignore_warning);
fprintf(stderr, ignore_error);
for (i = 0; i < dir.ignored_nr; i++) {
fprintf(stderr, "%s\n", dir.ignored[i]->name);
}
fprintf(stderr, "Use -f if you really want to add them.\n");
exit(1);
die("no files added");
}

for (i = 0; i < dir.nr; i++)
Expand Down

0 comments on commit b39c53e

Please sign in to comment.