summaryrefslogtreecommitdiff
path: root/builtin-update-index.c
diff options
context:
space:
mode:
authorDmitry Potapov <dpotapov@gmail.com>2008-10-11 20:39:37 +0400
committerShawn O. Pearce <spearce@spearce.org>2008-10-12 12:36:19 -0700
commit7e7abea96b8140c592a46293f5e33aae0683c7ac (patch)
tree316f1572ee0d7e51bae66b88a61a4120f1e34616 /builtin-update-index.c
parent616ab43737558b4e589104432a16cf9f331ac457 (diff)
downloadgit-7e7abea96b8140c592a46293f5e33aae0683c7ac.tar.gz
print an error message for invalid path
If verification of path failed, it is always better to print an error message saying this than relying on the caller function to print a meaningful error message (especially when the callee already prints error message for another situation). Because the callers of add_index_entry_with_check() did not print any error message, it resulted that the user would not notice the problem when checkout of an invalid path failed. Signed-off-by: Dmitry Potapov <dpotapov@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'builtin-update-index.c')
-rw-r--r--builtin-update-index.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-update-index.c b/builtin-update-index.c
index 417f9724ab..3a2291b03e 100644
--- a/builtin-update-index.c
+++ b/builtin-update-index.c
@@ -218,7 +218,7 @@ static int add_cacheinfo(unsigned int mode, const unsigned char *sha1,
struct cache_entry *ce;
if (!verify_path(path))
- return -1;
+ return error("Invalid path '%s'", path);
len = strlen(path);
size = cache_entry_size(len);