FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodegit/lib/submodule.js at v0.26.3 · nodegit/nodegit · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
nodegit
/
nodegit
Public
Notifications
You must be signed in to change notification settings
Fork
700
Star
5.8k
Code
Issues
343
Pull requests
20
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
nodegit
/
lib
/
submodule.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
51 lines (42 loc) · 1.36 KB
Breadcrumbs
nodegit
/
lib
/
submodule.js
Copy path
File metadata and controls
51 lines (42 loc) · 1.36 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
var
NodeGit
=
require
(
"../"
)
;
var
normalizeFetchOptions
=
NodeGit
.
Utils
.
normalizeFetchOptions
;
var
normalizeOptions
=
NodeGit
.
Utils
.
normalizeOptions
;
var
shallowClone
=
NodeGit
.
Utils
.
shallowClone
;
var
Submodule
=
NodeGit
.
Submodule
;
var
_foreach
=
Submodule
.
foreach
;
var
_update
=
Submodule
.
prototype
.
update
;
// Override Submodule.foreach to eliminate the need to pass null payload
Submodule
.
foreach
=
function
(
repo
,
callback
)
{
return
_foreach
(
repo
,
callback
,
null
)
;
}
;
/**
* Updates a submodule
*
*
@async
*
@param
{
Number
} init Setting this to 1 will initialize submodule
* before updating
*
@param
{
SubmoduleUpdateOptions
} options Submodule update settings
*
@return
{
Number
} 0 on success, any non-zero return value from a callback
*/
Submodule
.
prototype
.
update
=
function
(
init
,
options
)
{
var
fetchOpts
;
var
checkoutOpts
;
if
(
options
)
{
options
=
shallowClone
(
options
)
;
fetchOpts
=
options
.
fetchOpts
;
checkoutOpts
=
options
.
checkoutOpts
;
delete
options
.
fetchOpts
;
delete
options
.
checkoutOpts
;
}
options
=
normalizeOptions
(
options
,
NodeGit
.
SubmoduleUpdateOptions
)
;
if
(
fetchOpts
)
{
options
.
fetchOpts
=
normalizeFetchOptions
(
fetchOpts
)
;
}
if
(
checkoutOpts
)
{
options
.
checkoutOpts
=
normalizeOptions
(
checkoutOpts
,
NodeGit
.
CheckoutOptions
)
;
}
return
_update
.
call
(
this
,
init
,
options
)
;
}
;
Back
|
FazBrowse Home
|
New Git URL