diff options
| author | Derrick Stolee <dstolee@microsoft.com> | 2021-04-16 12:49:58 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2021-04-16 13:36:55 -0700 |
| commit | cfd781ea22e0f334d3c0104e1f34c47327934314 (patch) | |
| tree | aa9c39b5cb0b16b3a96c2dd6f271c25daef90eb2 /builtin | |
| parent | fetch: add --prefetch option (diff) | |
| download | git-cfd781ea22e0f334d3c0104e1f34c47327934314.tar.gz git-cfd781ea22e0f334d3c0104e1f34c47327934314.zip | |
maintenance: use 'git fetch --prefetch'
The 'prefetch' maintenance task previously forced the following refspec
for each remote:
+refs/heads/*:refs/prefetch/<remote>/*
If a user has specified a more strict refspec for the remote, then this
prefetch task downloads more objects than necessary.
The previous change introduced the '--prefetch' option to 'git fetch'
which manipulates the remote's refspec to place all resulting refs into
refs/prefetch/, with further partitioning based on the destinations of
those refspecs.
Update the documentation to be more generic about the destination refs.
Do not mention custom refspecs explicitly, as that does not need to be
highlighted in this documentation. The important part of placing refs in
refs/prefetch/ remains.
Reported-by: Tom Saeger <tom.saeger@oracle.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
| -rw-r--r-- | builtin/gc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin/gc.c b/builtin/gc.c index fa8128de9a..9d35f7da50 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -879,15 +879,14 @@ static int fetch_remote(struct remote *remote, void *cbdata) struct child_process child = CHILD_PROCESS_INIT; child.git_cmd = 1; - strvec_pushl(&child.args, "fetch", remote->name, "--prune", "--no-tags", + strvec_pushl(&child.args, "fetch", remote->name, + "--prefetch", "--prune", "--no-tags", "--no-write-fetch-head", "--recurse-submodules=no", - "--refmap=", NULL); + NULL); if (opts->quiet) strvec_push(&child.args, "--quiet"); - strvec_pushf(&child.args, "+refs/heads/*:refs/prefetch/%s/*", remote->name); - return !!run_command(&child); } |
