Skip to content

Commit

Permalink
fetchGit: fetch shallow, aka depth=1
Browse files Browse the repository at this point in the history
This was brought up in NixOS#1837 and seems sensible.

The issue talks about implementing a fallback, in case a shallow fetch
fails. This was not implemented so far, because I have not yet run into
a situation where it was necessary.
  • Loading branch information
ajs124 committed Mar 4, 2019
1 parent 8fbc483 commit 707bc80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libexpr/primops/fetchGit.cc
Expand Up @@ -128,7 +128,7 @@ GitInfo exportGit(ref<Store> store, const std::string & uri,

// FIXME: git stderr messes up our progress indicator, so
// we're using --quiet for now. Should process its stderr.
runProgram("git", true, { "-C", cacheDir, "fetch", "--quiet", "--force", "--", uri, fmt("%s:%s", *ref, *ref) });
runProgram("git", true, { "-C", cacheDir, "fetch", "--depth=1", "--quiet", "--force", "--", uri, fmt("%s:%s", *ref, *ref) });

struct timeval times[2];
times[0].tv_sec = now;
Expand Down

0 comments on commit 707bc80

Please sign in to comment.