Commit e41bf35
remote.c: drop default_remote_name variable
When we read the remote config from disk, we update a
default_remote_name variable if we see branch.*.remote
config for the current branch. This isn't wrong, or even all
that complicated, but it is a bit simpler (because it
reduces our overall state) to just lazily compute the
default when we need it.
The ulterior motive here is that the push config uses a
similar structure, and _is_ much more complicated as a
result. That will be simplified in a future patch, and it's
more readable if the logic for remotes and push-remotes
matches.
Note that we also used default_remote_name as a signal that
the remote config has been loaded; after this patch, we now
use an explicit flag.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 2dfb2e0 commit e41bf35
1 file changed
Lines changed: 11 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | 52 | | |
54 | 53 | | |
55 | | - | |
56 | 54 | | |
57 | 55 | | |
58 | 56 | | |
| |||
367 | 365 | | |
368 | 366 | | |
369 | 367 | | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
| 368 | + | |
376 | 369 | | |
377 | 370 | | |
378 | 371 | | |
| |||
501 | 494 | | |
502 | 495 | | |
503 | 496 | | |
| 497 | + | |
504 | 498 | | |
505 | 499 | | |
506 | 500 | | |
507 | | - | |
| 501 | + | |
| 502 | + | |
508 | 503 | | |
509 | | - | |
| 504 | + | |
| 505 | + | |
510 | 506 | | |
511 | 507 | | |
512 | 508 | | |
| |||
708 | 704 | | |
709 | 705 | | |
710 | 706 | | |
711 | | - | |
712 | | - | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
713 | 712 | | |
714 | 713 | | |
715 | 714 | | |
| |||
0 commit comments