Index: sdk/lib/_internal/pub/lib/src/git.dart |
diff --git a/sdk/lib/_internal/pub/lib/src/git.dart b/sdk/lib/_internal/pub/lib/src/git.dart |
index e94e493e82042fc111ce3d6a40604f8667d724f0..4e92a698b6a6a7ecdeb2dbe74a21cd05483ec398 100644 |
--- a/sdk/lib/_internal/pub/lib/src/git.dart |
+++ b/sdk/lib/_internal/pub/lib/src/git.dart |
@@ -6,9 +6,13 @@ |
library pub.git; |
import 'dart:async'; |
+import 'dart:io'; |
+ |
import 'io.dart'; |
import 'log.dart' as log; |
+import 'package:stack_trace/stack_trace.dart'; |
+ |
/// Tests whether or not the git command-line app is available for use. |
Future<bool> get isInstalled { |
if (_isGitInstalledCache != null) { |
@@ -67,8 +71,13 @@ Future<bool> _tryGitCommand(String command) { |
return runProcess(command, ["--version"]).then((results) { |
var regexp = new RegExp("^git version"); |
return results.stdout.length == 1 && regexp.hasMatch(results.stdout[0]); |
- }).catchError((err) { |
+ }).catchError((err, stackTrace) { |
// If the process failed, they probably don't have it. |
- return false; |
+ if (err is ProcessException) { |
+ log.io('Git command is not "$command": $err\n$stackTrace'); |
+ return false; |
+ } |
+ |
+ throw err; |
}); |
} |