|
7 | 7 | static const char fetch_pack_usage[] = |
8 | 8 | "git fetch-pack [--all] [--stdin] [--quiet|-q] [--keep|-k] [--thin] " |
9 | 9 | "[--include-tag] [--upload-pack=<git-upload-pack>] [--depth=<n>] " |
10 | | -"[--no-progress] [-v] [<host>:]<directory> [<refs>...]"; |
| 10 | +"[--no-progress] [--diag-url] [-v] [<host>:]<directory> [<refs>...]"; |
11 | 11 |
|
12 | 12 | static void add_sought_entry_mem(struct ref ***sought, int *nr, int *alloc, |
13 | 13 | const char *name, int namelen) |
@@ -81,6 +81,10 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix) |
81 | 81 | args.stdin_refs = 1; |
82 | 82 | continue; |
83 | 83 | } |
| 84 | + if (!strcmp("--diag-url", arg)) { |
| 85 | + args.diag_url = 1; |
| 86 | + continue; |
| 87 | + } |
84 | 88 | if (!strcmp("-v", arg)) { |
85 | 89 | args.verbose = 1; |
86 | 90 | continue; |
@@ -146,10 +150,14 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix) |
146 | 150 | fd[0] = 0; |
147 | 151 | fd[1] = 1; |
148 | 152 | } else { |
| 153 | + int flags = args.verbose ? CONNECT_VERBOSE : 0; |
| 154 | + if (args.diag_url) |
| 155 | + flags |= CONNECT_DIAG_URL; |
149 | 156 | conn = git_connect(fd, dest, args.uploadpack, |
150 | | - args.verbose ? CONNECT_VERBOSE : 0); |
| 157 | + flags); |
| 158 | + if (!conn) |
| 159 | + return args.diag_url ? 0 : 1; |
151 | 160 | } |
152 | | - |
153 | 161 | get_remote_heads(fd[0], NULL, 0, &ref, 0, NULL); |
154 | 162 |
|
155 | 163 | ref = fetch_pack(&args, fd, conn, ref, dest, |
|
0 commit comments