summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2018-02-09 20:32:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-02-09 21:10:11 (GMT)
commit0711883218039750f940d8febf05a81aa46d2ab9 (patch)
tree70c264340b43a0815aeff019ed03233b9dcc455a /builtin
parentce3ab21b0c179559621fb7450a6f8c24e0a28ddb (diff)
downloadgit-0711883218039750f940d8febf05a81aa46d2ab9.zip
git-0711883218039750f940d8febf05a81aa46d2ab9.tar.gz
git-0711883218039750f940d8febf05a81aa46d2ab9.tar.bz2
fetch: stop accessing "remote" variable indirectly
Access the "remote" variable passed to the fetch_one() directly rather than through the gtransport wrapper struct constructed in this function for other purposes. This makes the code more readable, as it's now obvious that the remote struct doesn't somehow get munged by the prepare_transport() function above, which takes the "remote" struct as an argument and constructs the "gtransport" struct, containing among other things the "remote" struct. A subsequent change will copy this pattern to access a new remote->prune_tags field, but without the use of the gtransport variable. It's useful once that change lands to see that the two pieces of code behave exactly the same. This pattern of accessing the container struct was added in 737c5a9cde ("fetch: make --prune configurable", 2013-07-13) when this code was initially introduced. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/fetch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 72085e3..a7705bc 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -1280,8 +1280,8 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
if (prune < 0) {
/* no command line request */
- if (0 <= gtransport->remote->prune)
- prune = gtransport->remote->prune;
+ if (0 <= remote->prune)
+ prune = remote->prune;
else if (0 <= fetch_prune_config)
prune = fetch_prune_config;
else