aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers/git.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2023-02-03 21:42:42 +0100
committerEelco Dolstra <edolstra@gmail.com>2023-02-07 16:01:36 +0100
commit81e75e4bf6083046155a0c1fd6e312b43a60f7da (patch)
treec5bff94245b82ab5d75b408e23b8620cf1b969a9 /src/libfetchers/git.cc
parent0d73313c55497f32dcff1546f0f0625391f7a833 (diff)
Add some progress indication when fetching submodules
Diffstat (limited to 'src/libfetchers/git.cc')
-rw-r--r--src/libfetchers/git.cc21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/libfetchers/git.cc b/src/libfetchers/git.cc
index 1f7d7c07d..fb80d248c 100644
--- a/src/libfetchers/git.cc
+++ b/src/libfetchers/git.cc
@@ -615,15 +615,24 @@ struct GitInputScheme : InputScheme
AutoDelete delTmpGitDir(tmpGitDir, true);
runProgram("git", true, { "-c", "init.defaultBranch=" + gitInitialBranch, "init", tmpDir, "--separate-git-dir", tmpGitDir });
- // TODO: repoDir might lack the ref (it only checks if rev
- // exists, see FIXME above) so use a big hammer and fetch
- // everything to ensure we get the rev.
- runProgram("git", true, { "-C", tmpDir, "fetch", "--quiet", "--force",
- "--update-head-ok", "--", repoDir, "refs/*:refs/*" });
+
+ {
+ // TODO: repoDir might lack the ref (it only checks if rev
+ // exists, see FIXME above) so use a big hammer and fetch
+ // everything to ensure we get the rev.
+ Activity act(*logger, lvlTalkative, actUnknown, fmt("making temporary clone of '%s'", tmpDir));
+ runProgram("git", true, { "-C", tmpDir, "fetch", "--quiet", "--force",
+ "--update-head-ok", "--", repoDir, "refs/*:refs/*" });
+ }
runProgram("git", true, { "-C", tmpDir, "checkout", "--quiet", input.getRev()->gitRev() });
+
runProgram("git", true, { "-C", tmpDir, "remote", "add", "origin", actualUrl });
- runProgram("git", true, { "-C", tmpDir, "submodule", "--quiet", "update", "--init", "--recursive" });
+
+ {
+ Activity act(*logger, lvlTalkative, actUnknown, fmt("fetching submodules of '%s'", tmpDir));
+ runProgram("git", true, { "-C", tmpDir, "submodule", "--quiet", "update", "--init", "--recursive" });
+ }
filter = isNotDotGitDirectory;
} else {