aboutsummaryrefslogtreecommitdiff
path: root/fetch-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-11-13 22:04:56 -0800
committerJunio C Hamano <junkio@cox.net>2006-11-24 15:42:49 -0800
commitcf01bd52efeb21084652b2b06b778ed458004e8f (patch)
tree338f1643acb79a5d531677c5d73d4d5c69d10e59 /fetch-pack.c
parent16ad35791099e5da118a0b6cfa0c3db4e2feff81 (diff)
downloadgit-cf01bd52efeb21084652b2b06b778ed458004e8f.tar.gz
git-cf01bd52efeb21084652b2b06b778ed458004e8f.tar.xz
We should make sure that the protocol is still extensible.
This just reformats if .. else if .. else chain to make it clear we are handling extended response from the other end.
Diffstat (limited to 'fetch-pack.c')
-rw-r--r--fetch-pack.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index c3064b94a..6fd457035 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -189,7 +189,7 @@ static int find_common(int fd[2], unsigned char *result_sha1,
if (!fetching)
return 1;
- if (depth > 0) {
+ if (depth > 0) {
char line[1024];
unsigned char sha1[20];
int len;
@@ -202,7 +202,9 @@ static int find_common(int fd[2], unsigned char *result_sha1,
if (lookup_object(sha1))
continue;
register_shallow(sha1);
- } else if (!strncmp("unshallow ", line, 10)) {
+ continue;
+ }
+ if (!strncmp("unshallow ", line, 10)) {
if (get_sha1_hex(line + 10, sha1))
die("invalid unshallow line: %s", line);
if (!lookup_object(sha1))
@@ -211,8 +213,9 @@ static int find_common(int fd[2], unsigned char *result_sha1,
parse_object(sha1);
if (unregister_shallow(sha1))
die("no shallow found: %s", line);
- } else
- die("expected shallow/unshallow, got %s", line);
+ continue;
+ }
+ die("expected shallow/unshallow, got %s", line);
}
}