({
fs,
http,
onProgress,
onMessage,
onAuth,
onAuthSuccess,
onAuthFailure,
onPostCheckout,
dir,
gitdir = join(dir, '.git'),
url,
corsProxy = undefined,
ref = undefined,
remote = 'origin',
depth = undefined,
since = undefined,
exclude = [],
relative = false,
singleBranch = false,
noCheckout = false,
noTags = false,
headers = {},
cache = {},
nonBlocking = false,
batchSize = 100,
})
| 53 | * |
| 54 | */ |
| 55 | export async function clone({ |
| 56 | fs, |
| 57 | http, |
| 58 | onProgress, |
| 59 | onMessage, |
| 60 | onAuth, |
| 61 | onAuthSuccess, |
| 62 | onAuthFailure, |
| 63 | onPostCheckout, |
| 64 | dir, |
| 65 | gitdir = join(dir, '.git'), |
| 66 | url, |
| 67 | corsProxy = undefined, |
| 68 | ref = undefined, |
| 69 | remote = 'origin', |
| 70 | depth = undefined, |
| 71 | since = undefined, |
| 72 | exclude = [], |
| 73 | relative = false, |
| 74 | singleBranch = false, |
| 75 | noCheckout = false, |
| 76 | noTags = false, |
| 77 | headers = {}, |
| 78 | cache = {}, |
| 79 | nonBlocking = false, |
| 80 | batchSize = 100, |
| 81 | }) { |
| 82 | try { |
| 83 | assertParameter('fs', fs) |
| 84 | assertParameter('http', http) |
| 85 | assertParameter('gitdir', gitdir) |
| 86 | if (!noCheckout) { |
| 87 | assertParameter('dir', dir) |
| 88 | } |
| 89 | assertParameter('url', url) |
| 90 | |
| 91 | const fsp = new FileSystem(fs) |
| 92 | const updatedGitdir = await discoverGitdir({ fsp, dotgit: gitdir }) |
| 93 | return await _clone({ |
| 94 | fs: fsp, |
| 95 | cache, |
| 96 | http, |
| 97 | onProgress, |
| 98 | onMessage, |
| 99 | onAuth, |
| 100 | onAuthSuccess, |
| 101 | onAuthFailure, |
| 102 | onPostCheckout, |
| 103 | dir, |
| 104 | gitdir: updatedGitdir, |
| 105 | url, |
| 106 | corsProxy, |
| 107 | ref, |
| 108 | remote, |
| 109 | depth, |
| 110 | since, |
| 111 | exclude, |
| 112 | relative, |
searching dependent graphs…