FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodegit.nodegit/lib/index.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
/
index.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
56 lines (48 loc) · 1.6 KB
Breadcrumbs
nodegit.nodegit
/
lib
/
index.js
Copy path
File metadata and controls
56 lines (48 loc) · 1.6 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
52
53
54
55
56
var
NodeGit
=
require
(
"../"
)
;
var
Index
=
NodeGit
.
Index
;
var
Status
=
NodeGit
.
Status
;
var
Pathspec
=
NodeGit
.
Pathspec
;
/**
* Return an array of the entries in this index.
*
@return
{
Array<IndexEntry>
} an array of IndexEntrys
*/
Index
.
prototype
.
entries
=
function
(
)
{
var
size
=
this
.
entryCount
(
)
;
var
result
=
[
]
;
for
(
var
i
=
0
;
i
<
size
;
i
++
)
{
result
.
push
(
this
.
getByIndex
(
i
)
)
;
}
return
result
;
}
;
var
addAll
=
Index
.
prototype
.
addAll
;
Index
.
prototype
.
addAll
=
function
(
pathspec
,
flags
,
matchedCallback
)
{
// This status path code is here to speedup addall, which currently is
// excessively slow due to adding every single unignored file to the index
// even if it has no changes. Remove this when it's fixed in libgit2
// https://github.com/libgit2/libgit2/issues/2687
var
paths
=
[
]
;
var
repo
=
this
.
owner
(
)
;
var
statusCB
=
function
(
path
)
{
paths
.
push
(
path
)
;
}
;
var
idx
=
this
;
var
ps
=
Pathspec
.
create
(
pathspec
||
"*"
)
;
return
Status
.
foreach
(
repo
,
statusCB
)
.
then
(
function
(
)
{
return
paths
;
}
)
.
then
(
function
(
paths
)
{
paths
=
paths
.
filter
(
function
(
path
)
{
return
!
!
(
ps
.
matchesPath
(
0
,
path
)
)
;
}
)
;
return
addAll
.
call
(
idx
,
paths
,
flags
,
matchedCallback
,
null
)
;
}
)
;
}
;
var
removeAll
=
Index
.
prototype
.
removeAll
;
Index
.
prototype
.
removeAll
=
function
(
pathspec
,
matchedCallback
)
{
return
removeAll
.
call
(
this
,
pathspec
||
"*"
,
matchedCallback
,
null
)
;
}
;
var
updateAll
=
Index
.
prototype
.
updateAll
;
Index
.
prototype
.
updateAll
=
function
(
pathspec
,
matchedCallback
)
{
return
updateAll
.
call
(
this
,
pathspec
||
"*"
,
matchedCallback
,
null
)
;
}
;
Back
|
FazBrowse Home
|
New Git URL