File tree 1 file changed +3
-4
lines changed
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 {
33
33
) {
34
34
filePath = normalizePath (filePath);
35
35
36
- var file = fs. file (filePath);
37
- if (! file. existsSync () ) {
36
+ var stat = stdlibc. stat (filePath);
37
+ if (stat == null ) {
38
38
throw GitFileNotFound (filePath);
39
39
}
40
40
@@ -45,7 +45,6 @@ extension Index on GitRepository {
45
45
// LB: Wait is this a linear search over all files??
46
46
// Maybe... but omitting it fully does not speed things up.
47
47
var ei = index.entries.indexWhere ((e) => e.path == pathSpec);
48
- var stat = stdlibc.stat (filePath)! ;
49
48
if (ei != - 1 ) {
50
49
var entry = index.entries[ei];
51
50
if (entry.cTime.isAtSameMomentAs (stat.st_ctim) &&
@@ -58,7 +57,7 @@ extension Index on GitRepository {
58
57
}
59
58
}
60
59
61
- var data = file.readAsBytesSync ();
60
+ var data = fs. file (filePath) .readAsBytesSync ();
62
61
var blob = GitBlob (data, null ); // Hash the file (takes time!)
63
62
var hash = objStorage.writeObject (blob);
64
63
You can’t perform that action at this time.
0 commit comments