@@ -76,7 +76,7 @@ class GitSource extends CachedSource {
76
76
} on FormatException {}
77
77
}
78
78
79
- if (validVersions.length > 0 ) {
79
+ if (validVersions.isNotEmpty ) {
80
80
return validVersions;
81
81
}
82
82
@@ -302,7 +302,7 @@ class GitSource extends CachedSource {
302
302
/// by [id] on the effective ref of [id] .
303
303
///
304
304
/// This assumes that the canonical clone already exists.
305
- Future <String > _getRev (PackageId id) {
305
+ Future <String > _getRev (PackageId id) async {
306
306
var ref = _getEffectiveRef (id);
307
307
return git
308
308
.run (["rev-list" , "--max-count=1" , ref], workingDir: _repoCachePath (id))
@@ -344,7 +344,7 @@ class GitSource extends CachedSource {
344
344
}
345
345
346
346
/// Checks out the reference [ref] in [repoPath] .
347
- Future _checkOut (String repoPath, String ref) {
347
+ Future _checkOut (String repoPath, String ref) async {
348
348
return git.run (["checkout" , ref], workingDir: repoPath)
349
349
.then ((result) => null )
350
350
.catchError ((_) {
@@ -359,14 +359,14 @@ class GitSource extends CachedSource {
359
359
///
360
360
/// It is possible that a pubspec didn't always exist, return null if
361
361
/// that is the case.
362
- Future <Pubspec > _getPubspec (String repoPath, String ref) {
363
- return git. run ([ 'show' , '$ ref :pubspec.yaml' ], workingDir : repoPath)
364
- . catchError ((_) => null )
365
- . then ((result) {
366
- if (result != null ) {
367
- return new Pubspec . parse (result. join ( ' \n ' ), systemCache.sources);
368
- }
369
- });
362
+ Future <Pubspec > _getPubspec (String repoPath, String ref) async {
363
+ try {
364
+ var result = await git. run ([ 'show' , '$ ref :pubspec.yaml' ],
365
+ workingDir : repoPath);
366
+ return new Pubspec . parse (result. join ( ' \n ' ), systemCache.sources);
367
+ } on git. GitException {
368
+ return null ;
369
+ }
370
370
}
371
371
372
372
/// Returns the path to the canonical clone of the repository referred to by
0 commit comments