summaryrefslogtreecommitdiff
path: root/update-cache.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-05-08 22:31:33 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-05-08 22:31:33 (GMT)
commitb3f94c4b554cd6c3db3e99dc33bdac7d8155d606 (patch)
tree406a52e77863919e6ad22ebf96ad8ede3e157d2e /update-cache.c
parent03ea2802495df568690760906e26dda753f75e1d (diff)
downloadgit-b3f94c4b554cd6c3db3e99dc33bdac7d8155d606.zip
git-b3f94c4b554cd6c3db3e99dc33bdac7d8155d606.tar.gz
git-b3f94c4b554cd6c3db3e99dc33bdac7d8155d606.tar.bz2
Fix git-update-cache --cacheinfo error message.
The error detection logic was too lazy to distinguish parameter error and unable-to-add case. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'update-cache.c')
-rw-r--r--update-cache.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/update-cache.c b/update-cache.c
index 69b1afe..2f5d620 100644
--- a/update-cache.c
+++ b/update-cache.c
@@ -369,8 +369,10 @@ int main(int argc, char **argv)
continue;
}
if (!strcmp(path, "--cacheinfo")) {
- if (i+3 >= argc || add_cacheinfo(argv[i+1], argv[i+2], argv[i+3]))
+ if (i+3 >= argc)
die("update-cache: --cacheinfo <mode> <sha1> <path>");
+ if (add_cacheinfo(argv[i+1], argv[i+2], argv[i+3]))
+ die("update-cache: --cacheinfo cannot add %s", argv[i+3]);
i += 3;
continue;
}