git-verify-pack: get rid of while loop
Get rid of that while loop which was apparently used as a way to avoid goto's (why?). It's easy now because there is only one break left at the end of it. Also make the comment clearer. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>maint
parent
68f4c78b95
commit
fc5fc50980
|
|
@ -11,9 +11,9 @@ static int verify_one_pack(const char *path, int verbose)
|
||||||
if (len >= PATH_MAX)
|
if (len >= PATH_MAX)
|
||||||
return error("name too long: %s", path);
|
return error("name too long: %s", path);
|
||||||
|
|
||||||
while (1) {
|
/*
|
||||||
/* Should name foo.idx, but foo.pack may be named;
|
* In addition to "foo.idx" we accept "foo.pack" and "foo";
|
||||||
* convert it to foo.idx
|
* normalize these forms to "foo.idx" for add_packed_git().
|
||||||
*/
|
*/
|
||||||
if (has_extension(arg, len, ".pack")) {
|
if (has_extension(arg, len, ".pack")) {
|
||||||
strcpy(arg + len - 5, ".idx");
|
strcpy(arg + len - 5, ".idx");
|
||||||
|
|
@ -24,10 +24,10 @@ static int verify_one_pack(const char *path, int verbose)
|
||||||
strcpy(arg + len, ".idx");
|
strcpy(arg + len, ".idx");
|
||||||
len += 4;
|
len += 4;
|
||||||
}
|
}
|
||||||
if ((g = add_packed_git(arg, len, 1)))
|
|
||||||
break;
|
if (!(g = add_packed_git(arg, len, 1)))
|
||||||
return error("packfile %s not found.", arg);
|
return error("packfile %s not found.", arg);
|
||||||
}
|
|
||||||
return verify_pack(g, verbose);
|
return verify_pack(g, verbose);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue