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 (has_extension(arg
, len
, ".pack")) {
14 strcpy(arg
+ len
- 5, ".idx");
17 /* Should name foo.idx now */
18 if ((g
= add_packed_git(arg
, len
, 1)))
20 /* No? did you name just foo? */
21 strcpy(arg
+ len
, ".idx");
23 if ((g
= add_packed_git(arg
, len
, 1)))
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;
42 if (!no_more_options
&& av
[1][0] == '-') {
43 if (!strcmp("-v", av
[1]))
45 else if (!strcmp("--", av
[1]))
48 usage(verify_pack_usage
);
52 if (verify_one_pack(path
, verbose
))
60 usage(verify_pack_usage
);