Commit 7a52a8c
clone: introduce struct clone_opts in builtin/clone.c
There is a lot of state stored in global variables in builtin/clone.c.
In the long run we'd like to remove many of those.
Introduce `struct clone_opts` in this file. This struct will be used to
contain all details needed to perform the clone. The struct object can
be thrown around to all the functions that need these details.
The first field we're adding is `wants_head`. In some scenarios
(specifically when both `--single-branch` and `--branch` are given) we
are not interested in `HEAD` on the remote. The field `wants_head` in
`struct clone_opts` will hold this information. We could have put
`option_branch` and `option_single_branch` into that struct instead, but
in a following commit we'll be using `wants_head` as well.
Signed-off-by: Toon Claes <toon@iotcl.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 2ca67c6 commit 7a52a8c
3 files changed
Lines changed: 35 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
60 | 67 | | |
61 | 68 | | |
62 | 69 | | |
| |||
429 | 436 | | |
430 | 437 | | |
431 | 438 | | |
432 | | - | |
433 | | - | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
434 | 442 | | |
435 | | - | |
436 | | - | |
437 | | - | |
| 443 | + | |
| 444 | + | |
438 | 445 | | |
439 | 446 | | |
440 | | - | |
441 | | - | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
442 | 452 | | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
449 | 457 | | |
450 | 458 | | |
451 | 459 | | |
| |||
893 | 901 | | |
894 | 902 | | |
895 | 903 | | |
| 904 | + | |
| 905 | + | |
896 | 906 | | |
897 | 907 | | |
898 | 908 | | |
| |||
1343 | 1353 | | |
1344 | 1354 | | |
1345 | 1355 | | |
1346 | | - | |
| 1356 | + | |
1347 | 1357 | | |
1348 | 1358 | | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
1349 | 1363 | | |
1350 | 1364 | | |
1351 | 1365 | | |
| |||
1454 | 1468 | | |
1455 | 1469 | | |
1456 | 1470 | | |
1457 | | - | |
| 1471 | + | |
1458 | 1472 | | |
1459 | 1473 | | |
1460 | 1474 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1234 | 1234 | | |
1235 | 1235 | | |
1236 | 1236 | | |
1237 | | - | |
| 1237 | + | |
1238 | 1238 | | |
1239 | 1239 | | |
1240 | 1240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
222 | 227 | | |
223 | 228 | | |
224 | 229 | | |
| |||
0 commit comments