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], unsigned flags)
14 get_remote_heads(fd[0], &ref, 0, NULL, flags);
18 printf("%s %s\n", sha1_to_hex(ref->old_sha1), ref->name);
24 int main(int argc, char **argv)
33 setup_git_directory_gently(&nongit);
35 for (i = 1; i < argc; i++) {
39 if (!strncmp("--exec=", arg, 7)) {
43 if (!strcmp("--tags", arg)) {
47 if (!strcmp("--heads", arg)) {
51 if (!strcmp("--refs", arg)) {
55 usage(peek_remote_usage);
61 if (!dest || i != argc - 1)
62 usage(peek_remote_usage);
64 pid = git_connect(fd, dest, exec);
67 ret = peek_remote(fd, flags);