From: Alex Riesen Date: Fri, 13 Apr 2007 07:42:47 GMT Subject: Re: Teach git-update-index about gitlinks Message-ID: <81b0412b0704130042k1f5be3bay30cbbb6b70259f6@mail.gmail.com> In-Reply-To: On 4/12/07, Linus Torvalds 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?