| static const char peek_remote_usage[] = |
| "git-peek-remote [--exec=upload-pack] [host:]directory"; |
| static const char *exec = "git-upload-pack"; |
| static int peek_remote(int fd[2]) |
| get_remote_heads(fd[0], &ref, 0, NULL, 0); |
| printf("%s %s\n", sha1_to_hex(ref->old_sha1), ref->name); |
| int main(int argc, char **argv) |
| setup_git_directory_gently(&nongit); |
| for (i = 1; i < argc; i++) { |
| if (!strncmp("--exec=", arg, 7)) |
| usage(peek_remote_usage); |
| if (!dest || i != argc - 1) |
| usage(peek_remote_usage); |
| pid = git_connect(fd, dest, exec); |