Re: git add / update-cache --add fails.
Herbert Xu <herbert@gondor.apana.org.au> writes:
Show 8 quoted lines
> Rhys Hardwick <rhys@rhyshardwick.co.uk> wrote:
>>
>> rhys@metatron:~/repo/learning.repo$ strace update-cache --add w1d4p1.c
> ...
>> open("w1d4p1.c", O_RDONLY) = -1 ENOENT (No such file or
>> directory)
>
> The file that you're trying to add doesn't exist.Maybe the user should be informed as soon as update-cache knows that?
update-cache.c: 11388582a830a6161d1c769aa8616bed6f593b8a
--- a/update-cache.c
+++ b/update-cache.c
@@ -98,6 +98,7 @@ static int add_file_to_cache(char *path)
fd = open(path, O_RDONLY);
if (fd < 0) {
+ fprintf(stderr, "update-cache Error: %s\n", strerror(errno));
if (errno == ENOENT) {
if (allow_remove)
return remove_file_from_cache(path);
By the way, I created that patch with "git diff" in my git-pasky
working directory. Strangely, I had to redirect standard error to the
same place as standard output in order to get the filename in the diff
output. I didn't check why the filename is on standard error,
though.
--
Ed L Cashin <ecashin@coraid.com>