6 static const char peek_remote_usage
[] =
7 "git-peek-remote [--exec=upload-pack] [host:]directory";
8 static const char *exec
= "git-upload-pack";
10 static int peek_remote(int fd
[2])
14 get_remote_heads(fd
[0], &ref
, 0, NULL
, 0);
18 printf("%s %s\n", sha1_to_hex(ref
->old_sha1
), ref
->name
);
24 int main(int argc
, char **argv
)
31 for (i
= 1; i
< argc
; i
++) {
35 if (!strncmp("--exec=", arg
, 7))
38 usage(peek_remote_usage
);
44 if (!dest
|| i
!= argc
- 1)
45 usage(peek_remote_usage
);
47 pid
= git_connect(fd
, dest
, exec
);
50 ret
= peek_remote(fd
);