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

Unified Diff: sdk/lib/_internal/pub/lib/src/git.dart

Issue 145633008: Ensure that a locked git dependency is downloaded correctly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: forgot the test Created 6 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
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
});
}
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698