Skip to content

Commit

Permalink
git-add: warn when adding an ignored file with an explicit request.
Browse files Browse the repository at this point in the history
We allow otherwise ignored paths to be added to the index by
spelling its path out on the command line, but we would warn the
user about them when we do so.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Dec 25, 2006
1 parent e23ca9e commit 1e423f5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions builtin-add.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ static void prune_directory(struct dir_struct *dir, const char **pathspec, int p
free(entry);
continue;
}
if (entry->ignored_entry)
fprintf(stderr, "warning: '%s' is an ignored path.\n",
entry->name);
*dst++ = entry;
}
dir->nr = dst - dir->entries;
Expand Down

0 comments on commit 1e423f5

Please sign in to comment.