Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Unified Diff: lib/src/source/git.dart

Issue 2184303002: Make pub strong-mode clean. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/src/source/git.dart
diff --git a/lib/src/source/git.dart b/lib/src/source/git.dart
index 90f417777f39f93bfebad9dd9b7498c9d85be0fd..b246f36a8f5834c8507a4f3b14a57a47f2255514 100644
--- a/lib/src/source/git.dart
+++ b/lib/src/source/git.dart
@@ -156,11 +156,10 @@ class BoundGitSource extends CachedSource {
/// package.
Future<String> getPackageNameFromRepo(String repo) {
// Clone the repo to a temp directory.
- return withTempDir((tempDir) {
- return _clone(repo, tempDir, shallow: true).then((_) {
- var pubspec = new Pubspec.load(tempDir, systemCache.sources);
- return pubspec.name;
- });
+ return withTempDir((tempDir) async {
+ await _clone(repo, tempDir, shallow: true);
+ var pubspec = new Pubspec.load(tempDir, systemCache.sources);
+ return pubspec.name;
});
}
@@ -249,8 +248,8 @@ class BoundGitSource extends CachedSource {
Future<Pair<List<PackageId>, List<PackageId>>> repairCachedPackages() async {
if (!dirExists(systemCacheRoot)) return new Pair([], []);
- var successes = [];
- var failures = [];
+ var successes = <PackageId>[];
+ var failures = <PackageId>[];
var packages = listDir(systemCacheRoot)
.where((entry) => dirExists(path.join(entry, ".git")))

Powered by Google App Engine
This is Rietveld 408576698