4 static int verify_one_pack(char *arg
, int verbose
)
10 /* Should name foo.idx, but foo.pack may be named;
11 * convert it to foo.idx
13 if (!strcmp(arg
+ len
- 5, ".pack")) {
14 strcpy(arg
+ len
- 5, ".idx");
17 /* Should name foo.idx now */
18 if ((g
= add_packed_git(arg
, len
)))
20 /* No? did you name just foo? */
21 strcpy(arg
+ len
, ".idx");
23 if ((g
= add_packed_git(arg
, len
)))
25 return error("packfile %s not found.", arg
);
27 return verify_pack(g
, verbose
);
30 static const char *verify_pack_usage
= "git-verify-pack [-v] <pack>...";
32 int main(int ac
, char **av
)
36 int no_more_options
= 0;
41 if (!no_more_options
&& av
[1][0] == '-') {
42 if (!strcmp("-v", av
[1]))
44 else if (!strcmp("--", av
[1]))
47 usage(verify_pack_usage
);
51 if (verify_one_pack(path
, verbose
))