({
fs,
http,
onProgress,
onMessage,
onAuth,
onAuthSuccess,
onAuthFailure,
onPrePush,
dir,
gitdir = join(dir, '.git'),
ref,
remoteRef,
remote = 'origin',
url,
force = false,
delete: _delete = false,
corsProxy,
headers = {},
cache = {},
})
| 56 | * |
| 57 | */ |
| 58 | export async function push({ |
| 59 | fs, |
| 60 | http, |
| 61 | onProgress, |
| 62 | onMessage, |
| 63 | onAuth, |
| 64 | onAuthSuccess, |
| 65 | onAuthFailure, |
| 66 | onPrePush, |
| 67 | dir, |
| 68 | gitdir = join(dir, '.git'), |
| 69 | ref, |
| 70 | remoteRef, |
| 71 | remote = 'origin', |
| 72 | url, |
| 73 | force = false, |
| 74 | delete: _delete = false, |
| 75 | corsProxy, |
| 76 | headers = {}, |
| 77 | cache = {}, |
| 78 | }) { |
| 79 | try { |
| 80 | assertParameter('fs', fs) |
| 81 | assertParameter('http', http) |
| 82 | assertParameter('gitdir', gitdir) |
| 83 | |
| 84 | const fsp = new FileSystem(fs) |
| 85 | const updatedGitdir = await discoverGitdir({ fsp, dotgit: gitdir }) |
| 86 | return await _push({ |
| 87 | fs: fsp, |
| 88 | cache, |
| 89 | http, |
| 90 | onProgress, |
| 91 | onMessage, |
| 92 | onAuth, |
| 93 | onAuthSuccess, |
| 94 | onAuthFailure, |
| 95 | onPrePush, |
| 96 | gitdir: updatedGitdir, |
| 97 | ref, |
| 98 | remoteRef, |
| 99 | remote, |
| 100 | url, |
| 101 | force, |
| 102 | delete: _delete, |
| 103 | corsProxy, |
| 104 | headers, |
| 105 | }) |
| 106 | } catch (err) { |
| 107 | err.caller = 'git.push' |
| 108 | throw err |
| 109 | } |
| 110 | } |
no test coverage detected
searching dependent graphs…