Re: Teach git-update-index about gitlinks
- From
Alex Riesen <raa.lkml@gmail.com>
- Date
- Apr 13, 2007, 07:42 UTC
- Message-ID
- <81b0412b0704130042k1f5be3bay30cbbb6b70259f6@mail.gmail.com>
- In-Reply-To
- <Pine.LNX.4.64.0704121218130.4061@woody.linux-foundation.org>
On 4/12/07, Linus Torvalds <torvalds@linux-foundation.org> wrote:
Show 5 quoted lines
> +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)
...
Show 6 quoted lines
> 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?