FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodegit/lib/clone.js at master · codercatdev/nodegit · GitHub
codercatdev
nodegit
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
nodegit
/
lib
/
clone.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
33 lines (27 loc) · 892 Bytes
Breadcrumbs
nodegit
/
lib
/
clone.js
Copy path
File metadata and controls
33 lines (27 loc) · 892 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var
NodeGit
=
require
(
"../"
)
;
var
shallowClone
=
NodeGit
.
Utils
.
shallowClone
;
var
normalizeFetchOptions
=
NodeGit
.
Utils
.
normalizeFetchOptions
;
var
normalizeOptions
=
NodeGit
.
Utils
.
normalizeOptions
;
var
Clone
=
NodeGit
.
Clone
;
var
_clone
=
Clone
.
clone
;
/**
* Patch repository cloning to automatically coerce objects.
*
*
@async
*
@param
{
String
} url url of the repository
*
@param
{
String
} local_path local path to store repository
*
@param
{
CloneOptions
} [options]
*
@return
{
Repository
} repo
*/
Clone
.
clone
=
function
(
url
,
local_path
,
options
)
{
var
fetchOpts
=
normalizeFetchOptions
(
options
&&
options
.
fetchOpts
)
;
if
(
options
)
{
options
=
shallowClone
(
options
)
;
delete
options
.
fetchOpts
;
}
options
=
normalizeOptions
(
options
,
NodeGit
.
CloneOptions
)
;
if
(
options
)
{
options
.
fetchOpts
=
fetchOpts
;
}
return
_clone
.
call
(
this
,
url
,
local_path
,
options
)
;
}
;
Back
|
FazBrowse Home
|
New Git URL