+
+ if (allow_options && *path == '-') {
+ if (!strcmp(path, "--")) {
+ allow_options = 0;
+ continue;
+ }
+ if (!strcmp(path, "--add")) {
+ allow_add = 1;
+ continue;
+ }
+ if (!strcmp(path, "--replace")) {
+ allow_replace = 1;
+ continue;
+ }
+ if (!strcmp(path, "--remove")) {
+ allow_remove = 1;
+ continue;
+ }
+ if (!strcmp(path, "--refresh")) {
+ has_errors |= refresh_cache();
+ continue;
+ }
+ if (!strcmp(path, "--cacheinfo")) {
+ if (i+3 >= argc)
+ die("git-update-cache: --cacheinfo <mode> <sha1> <path>");
+ if (add_cacheinfo(argv[i+1], argv[i+2], argv[i+3]))
+ die("git-update-cache: --cacheinfo cannot add %s", argv[i+3]);
+ i += 3;
+ continue;
+ }
+ if (!strcmp(path, "--force-remove")) {
+ if (argc <= i + 1)
+ die("git-update-cache: --force-remove <path>");
+ if (remove_file_from_cache(argv[i+1]))
+ die("git-update-cache: --force-remove cannot remove %s", argv[i+1]);
+ i++;
+ continue;
+ }
+
+ if (!strcmp(path, "--ignore-missing")) {
+ not_new = 1;
+ continue;
+ }
+ die("unknown option %s", path);
+ }