X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=update-cache.c;h=3d1fd2be7593ac832e40c3f64b207d2bf5318e39;hb=b893f09104ee5f1d8710dfe17cdf1cbac995f17a;hp=63815ed658e9c2007938309458444b218c330d68;hpb=9d34c29db39bdb5c2443475dd6a24cfc5c2c9e37;p=git.git diff --git a/update-cache.c b/update-cache.c index 63815ed6..3d1fd2be 100644 --- a/update-cache.c +++ b/update-cache.c @@ -53,7 +53,11 @@ static int add_file_to_cache(char *path) if (allow_remove) return remove_file_from_cache(path); } - return error("open(\"%s\"): %s", path, strerror(errno)); + if (0 == status) + return error("%s: is a directory", path); + else + return error("lstat(\"%s\"): %s", path, + strerror(errno)); } namelen = strlen(path); size = cache_entry_size(namelen); @@ -393,7 +397,7 @@ int main(int argc, char **argv) continue; } if (add_file_to_cache(path)) - die("Unable to add %s to database", path); + die("Unable to add %s to database; maybe you want to use --add option?", path); } if (write_cache(newfd, active_cache, active_nr) || commit_index_file(&cache_file))