11var NodeGit = require ( "../" ) ;
22
33var Index = NodeGit . Index ;
4- var Status = NodeGit . Status ;
54var Pathspec = NodeGit . Pathspec ;
65
76/**
@@ -21,28 +20,7 @@ Index.prototype.entries = function() {
2120
2221var addAll = Index . prototype . addAll ;
2322Index . prototype . addAll = function ( pathspec , flags , matchedCallback ) {
24- // This status path code is here to speedup addall, which currently is
25- // excessively slow due to adding every single unignored file to the index
26- // even if it has no changes. Remove this when it's fixed in libgit2
27- // https://github.com/libgit2/libgit2/issues/2687
28- var paths = [ ] ;
29- var repo = this . owner ( ) ;
30- var statusCB = function ( path ) {
31- paths . push ( path ) ;
32- } ;
33- var idx = this ;
34- var ps = Pathspec . create ( pathspec || "*" ) ;
35-
36- return Status . foreach ( repo , statusCB )
37- . then ( function ( ) {
38- return paths ;
39- } )
40- . then ( function ( paths ) {
41- paths = paths . filter ( function ( path ) {
42- return ! ! ( ps . matchesPath ( 0 , path ) ) ;
43- } ) ;
44- return addAll . call ( idx , paths , flags , matchedCallback , null ) ;
45- } ) ;
23+ return addAll . call ( this , pathspec || "*" , flags , matchedCallback , null ) ;
4624} ;
4725
4826var removeAll = Index . prototype . removeAll ;
0 commit comments