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

Unified Diff: utils/tests/pub/test_pub.dart

Issue 12042053: Get rid of unneeded Future.immediate() calls. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
« utils/pub/entrypoint.dart ('K') | « utils/pub/validator/name.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/test_pub.dart
diff --git a/utils/tests/pub/test_pub.dart b/utils/tests/pub/test_pub.dart
index 2ded719bb7a4f58d557eedb971ee80c9b2b4a8d4..e9343d037c9480372b1d26961abe09d143b7d271 100644
--- a/utils/tests/pub/test_pub.dart
+++ b/utils/tests/pub/test_pub.dart
@@ -21,6 +21,10 @@ import '../../../pkg/unittest/lib/unittest.dart';
import '../../../pkg/http/lib/testing.dart';
import '../../lib/file_system.dart' as fs;
import '../../pub/entrypoint.dart';
+// TODO(rnystrom): Using "gitlib" as the prefix here is ugly, but "git" collides
+// with the git descriptor method. Maybe we should try to clean up the top level
+// scope a bit?
+import '../../pub/git.dart' as gitlib;
import '../../pub/git_source.dart';
import '../../pub/hosted_source.dart';
import '../../pub/http.dart';
@@ -475,7 +479,6 @@ void _run() {
_scheduledCleanup = null;
_scheduledOnException = null;
if (createdSandboxDir != null) return deleteDir(createdSandboxDir);
- return new Future.immediate(null);
});
}
@@ -638,7 +641,7 @@ Future _doPub(Function fn, sandboxDir, List args, Future<Uri> tokenEndpoint) {
/// about the pub git tests).
void ensureGit() {
_schedule((_) {
- return isGitInstalled.then((installed) {
+ return gitlib.isInstalled.then((installed) {
if (!installed &&
!Platform.environment.containsKey('BUILDBOT_BUILDERNAME')) {
_abortScheduled = true;
@@ -1065,15 +1068,8 @@ class GitRepoDescriptor extends DirectoryDescriptor {
'GIT_COMMITTER_EMAIL': 'pub@dartlang.org'
};
- return runGit(args, workingDir: workingDir.path,
- environment: environment).then((result) {
- if (!result.success) {
- throw "Error running: git ${Strings.join(args, ' ')}\n"
- "${Strings.join(result.stderr, '\n')}";
- }
-
- return result.stdout;
- });
+ return gitlib.run(args, workingDir: workingDir.path,
+ environment: environment);
}
}
« utils/pub/entrypoint.dart ('K') | « utils/pub/validator/name.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698