File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,8 @@ extension Index on GitRepository {
3333 ) {
3434 filePath = normalizePath (filePath);
3535
36- var file = fs. file (filePath);
37- if (! file. existsSync () ) {
36+ var stat = stdlibc. stat (filePath);
37+ if (stat == null ) {
3838 throw GitFileNotFound (filePath);
3939 }
4040
@@ -45,7 +45,6 @@ extension Index on GitRepository {
4545 // LB: Wait is this a linear search over all files??
4646 // Maybe... but omitting it fully does not speed things up.
4747 var ei = index.entries.indexWhere ((e) => e.path == pathSpec);
48- var stat = stdlibc.stat (filePath)! ;
4948 if (ei != - 1 ) {
5049 var entry = index.entries[ei];
5150 if (entry.cTime.isAtSameMomentAs (stat.st_ctim) &&
@@ -58,7 +57,7 @@ extension Index on GitRepository {
5857 }
5958 }
6059
61- var data = file.readAsBytesSync ();
60+ var data = fs. file (filePath) .readAsBytesSync ();
6261 var blob = GitBlob (data, null ); // Hash the file (takes time!)
6362 var hash = objStorage.writeObject (blob);
6463
You can’t perform that action at this time.
0 commit comments