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

Unified Diff: utils/pub/git.dart

Issue 11830017: Fix ALL the pub tests. (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
Index: utils/pub/git.dart
diff --git a/utils/pub/git.dart b/utils/pub/git.dart
index df2e8565c3a2fc8ea8d77c20b4c2012498bad3d0..ecbc8a0770e9ff5ac204b3384a13369471ff04d8 100644
--- a/utils/pub/git.dart
+++ b/utils/pub/git.dart
@@ -65,21 +65,12 @@ Future<String> get _gitCommand {
/// Checks whether [command] is the Git command for this computer.
Future<bool> _tryGitCommand(String command) {
- var completer = new Completer<bool>();
-
// If "git --version" prints something familiar, git is working.
- var future = runProcess(command, ["--version"]);
-
- future
- .then((results) {
- var regex = new RegExp("^git version");
- completer.complete(results.stdout.length == 1 &&
- regex.hasMatch(results.stdout[0]));
- })
- .catchError((err) {
- // If the process failed, they probably don't have it.
- completer.complete(false);
- });
-
- return completer.future;
+ return runProcess(command, ["--version"]).then((results) {
+ var regexp = new RegExp("^git version");
+ return results.stdout.length == 1 && regexp.hasMatch(results.stdout[0]);
+ }).catchError((err) {
+ // If the process failed, they probably don't have it.
+ return false;
+ });
Bob Nystrom 2013/01/09 16:49:23 Much nicer!
}

Powered by Google App Engine
This is Rietveld 408576698