FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodegit.nodegit/lib/merge.js at enable-stash · 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
/
merge.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
26 lines (23 loc) · 916 Bytes
Breadcrumbs
nodegit.nodegit
/
lib
/
merge.js
Copy path
File metadata and controls
26 lines (23 loc) · 916 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
var
NodeGit
=
require
(
"../"
)
;
var
normalizeOptions
=
NodeGit
.
Utils
.
normalizeOptions
;
var
Promise
=
require
(
"nodegit-promise"
)
;
var
Merge
=
NodeGit
.
Merge
;
var
mergeCommits
=
Merge
.
commits
;
/**
* Merge 2 commits together and create an new index that can
* be used to create a merge commit.
*
*
@param
{
Repository
} repo Repository that contains the given commits
*
@param
{
Commit
} ourCommit The commit that reflects the destination tree
*
@param
{
Commit
} theirCommit The commit to merge into ourCommit
*
@param
{
MergeOptions
} [options] The merge tree options (null for default)
*/
Merge
.
commits
=
function
(
repo
,
ourCommit
,
theirCommit
,
options
)
{
options
=
normalizeOptions
(
options
,
NodeGit
.
MergeOptions
)
;
return
Promise
.
all
(
[
repo
.
getCommit
(
ourCommit
)
,
repo
.
getCommit
(
theirCommit
)
]
)
.
then
(
function
(
commits
)
{
return
mergeCommits
.
call
(
this
,
repo
,
commits
[
0
]
,
commits
[
1
]
,
options
)
;
}
)
;
}
;
Back
|
FazBrowse Home
|
New Git URL