Modules | @vltpkg/git
Type Aliases
FindOpts
Type declaration
cwd?
root?
Defined in
git/src/find.ts:4
GitOptions
This extends all options that can be passed to spawn() or pickManifest.
Type declaration
cwd?
the current working directory to perform git operations in
fetch-retries?
Only relevant if retry
is unset. Value for retry.retries, default 2
fetch-retry-factor?
Only relevant if retry
is unset. Value for retry.factor, default 10
fetch-retry-maxtimeout?
Only relevant if retry
is unset. Value for retry.maxTimeout, default
60_000
fetch-retry-mintimeout?
Only relevant if retry
is unset. Value for retry.minTimeout, default
1_000
git?
the path to git binary, or ‘false’ to prevent all git operations
git-shallow?
Set to a boolean to force cloning with/without --depth=1
. If left
undefined, then shallow cloning will only be performed on hosts known to
support it.
noGitRevCache?
Just to test rev lookup without continually clearing the cache
spec?
Parsed git specifier to be cloned, if we have one
Defined in
git/src/index.ts:17
Variables
shallowHosts
Only these whitelisted hosts get shallow cloning. Many hosts (including GHE) don’t always support it. A failed shallow fetch takes a LOT longer than a full fetch in most cases, so we skip it entirely. Set opts.gitShallow = true/false to force this behavior one way or the other.
If other hosts are added to this set, then they will be shallowly cloned as well.
Defined in
git/src/clone.ts:27
Functions
clone()
Parameters
• repo: string
• ref: string
= 'HEAD'
• target: undefined
| string
= undefined
• opts: GitOptions
= {}
Returns
Promise
<string
| Buffer
& string
>
Defined in
git/src/clone.ts:35
find()
Parameters
• __namedParameters: FindOpts
= {}
Returns
Promise
<undefined
| string
>
Defined in
git/src/find.ts:8
is()
Parameters
• __namedParameters = {}
• __namedParameters.cwd: undefined
| string
= ...
Returns
Promise
<boolean
>
Defined in
git/src/is.ts:3
isClean()
Parameters
• opts = {}
Returns
Promise
<boolean
>
Defined in
git/src/is-clean.ts:4
resolve()
Given a repo and either a ref or a git specifier Spec object, resolve the appropriate ref that we should clone, ideally witout actually cloning the repository.
Parameters
• repo: string
• ref: string
= 'HEAD'
• opts: GitOptions
= {}
Returns
Promise
<undefined
| RevDocEntry
>
Defined in
git/src/resolve.ts:13
resolveRef()
Given a repo’s RevDoc object and either a ref or a git specifier Spec object, resolve the appropriate ref that we should clone, witout actually cloning the repository.
Parameters
• revDoc: RevDoc
• ref: string
= 'HEAD'
• opts: GitOptions
= {}
Returns
undefined
| RevDocEntry
Defined in
git/src/resolve.ts:29
revs()
Parameters
• repo: string
• opts: GitOptions
= {}
Returns
Promise
<undefined
| RevDoc
>
Defined in
git/src/revs.ts:32
spawn()
Parameters
• gitArgs: string
[]
• opts: GitOptions
= {}
Returns
Promise
<SpawnResult
& object
& object
& object
>
Defined in
git/src/spawn.ts:13