Browse Source

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>
maint
Junio C Hamano 20 years ago
parent
commit
b3f94c4b55
  1. 4
      update-cache.c

4
update-cache.c

@ -369,8 +369,10 @@ int main(int argc, char **argv) @@ -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;
}

Loading…
Cancel
Save