FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodegit.nodegit/lib/remote.js at master · javascript-forks/nodegit.nodegit · GitHub
javascript-forks
nodegit.nodegit
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
nodegit.nodegit
/
lib
/
remote.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
44 lines (37 loc) · 1.35 KB
Breadcrumbs
nodegit.nodegit
/
lib
/
remote.js
Copy path
File metadata and controls
44 lines (37 loc) · 1.35 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
var
NodeGit
=
require
(
"../"
)
;
var
normalizeOptions
=
NodeGit
.
Utils
.
normalizeOptions
;
var
lookupWrapper
=
NodeGit
.
Utils
.
lookupWrapper
;
var
Remote
=
NodeGit
.
Remote
;
var
setCallbacks
=
Remote
.
prototype
.
setCallbacks
;
var
push
=
Remote
.
prototype
.
push
;
/**
* Retrieves the remote by name
*
@async
*
@param
{
Repository
} repo The repo that the remote lives in
*
@param
{
String|Remote
} name The remote to lookup
*
@param
{
Function
} callback
*
@return
{
Remote
}
*/
Remote
.
lookup
=
lookupWrapper
(
Remote
)
;
Remote
.
prototype
.
setCallbacks
=
function
(
callbacks
)
{
callbacks
=
normalizeOptions
(
callbacks
,
NodeGit
.
RemoteCallbacks
)
;
return
setCallbacks
.
call
(
this
,
callbacks
)
;
}
;
/**
* Pushes to a remote
*
*
@async
*
@param
{
Array
} refSpecs The ref specs that should be pushed
*
@param
{
PushOptions
} options Options for the checkout
*
@param
{
Signature
} signature The identity to use for the reflog of the
* updated references
*
@param
{
String
} message The message to use for the update reflog messages
*
@return
{
Number
} error code
*/
Remote
.
prototype
.
push
=
function
(
refSpecs
,
options
,
signature
,
message
)
{
options
=
normalizeOptions
(
options
,
NodeGit
.
PushOptions
)
;
signature
=
signature
||
this
.
owner
(
)
.
defaultSignature
(
)
;
message
=
message
||
"Push to "
+
this
.
name
(
)
;
return
push
.
call
(
this
,
refSpecs
,
options
,
signature
,
message
)
;
}
;
module
.
exports
=
Remote
;
Back
|
FazBrowse Home
|
New Git URL