On 4/12/07, Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
+static int process_lstat_error(const char *path, int err) +{ + if (err == ENOENT || err == ENOTDIR) + return remove_one_path(path); + return error("lstat(\"%s\"): %s", path, strerror(errno));
You forgot to change errno to err in strerror.
+static int add_one_path(struct cache_entry *old, const char *path, int len, struct stat *st)
...
option = allow_add ? ADD_CACHE_OK_TO_ADD : 0; option |= allow_replace ? ADD_CACHE_OK_TO_REPLACE : 0; if (add_cache_entry(ce, option)) - return error("%s: cannot add to the index - missing --add option?", - path); + return error("%s: cannot add to the index - missing --add option?", path);
return error("%s: cannot add to the index%s", path, "\0 - missing --add option?" + !allow_add); is be nicer. We really do know whether "--add" was passed or not.
+ * (NOTE! This is old and arguably fairly strange behaviour. + * We might want to make this an error unconditionally, and + * use "--force-remove" if you actually want to force removal).
...
+ /* Should this be an unconditional error? */ + return remove_one_path(path);
Makes me uncomfortable too. Is it be possible anyone is depending on it? Maybe it still can be changed? - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html