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

Unified Diff: utils/pub/git_source.dart

Issue 11066066: Include stderr on git failure. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove test code. Created 8 years, 2 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 | « utils/pub/git.dart ('k') | utils/pub/pub.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/git_source.dart
diff --git a/utils/pub/git_source.dart b/utils/pub/git_source.dart
index ca3bb712ef1af6a566a59ff19707c29036b27040..27ff5af776fd2ac598f6f0ac17814272294c0899 100644
--- a/utils/pub/git_source.dart
+++ b/utils/pub/git_source.dart
@@ -4,6 +4,7 @@
#library('git_source');
+#import('git.dart', prefix: 'git');
#import('io.dart');
#import('package.dart');
#import('source.dart');
@@ -37,7 +38,7 @@ class GitSource extends Source {
Future<Package> installToSystemCache(PackageId id) {
var revisionCachePath;
- return isGitInstalled.chain((installed) {
+ return git.isInstalled.chain((installed) {
if (!installed) {
throw new Exception(
"Cannot install '${id.name}' from Git (${_getUrl(id)}).\n"
@@ -117,10 +118,7 @@ class GitSource extends Source {
return exists(path).chain((exists) {
if (!exists) return _clone(_getUrl(id), path, mirror: true);
- return runGit(["fetch"], workingDir: path).transform((result) {
- if (!result.success) throw 'Git failed.';
- return null;
- });
+ return git.run(["fetch"], workingDir: path).transform((result) => null);
});
}
@@ -128,11 +126,8 @@ class GitSource extends Source {
* Returns a future that completes to the revision hash of [id].
*/
Future<String> _revisionAt(PackageId id) {
- return runGit(["rev-parse", _getEffectiveRef(id)],
- workingDir: _repoCachePath(id)).transform((result) {
- if (!result.success) throw 'Git failed.';
- return result.stdout[0];
- });
+ return git.run(["rev-parse", _getEffectiveRef(id)],
+ workingDir: _repoCachePath(id)).transform((result) => result[0]);
}
/**
@@ -158,21 +153,16 @@ class GitSource extends Source {
return ensureDir(to).chain((_) {
var args = ["clone", from, to];
if (mirror) args.insertRange(1, 1, "--mirror");
- return runGit(args);
- }).transform((result) {
- if (!result.success) throw 'Git failed.';
- return null;
- });
+ return git.run(args);
+ }).transform((result) => null);
}
/**
* Checks out the reference [ref] in [repoPath].
*/
Future _checkOut(String repoPath, String ref) {
- return runGit(["checkout", ref], workingDir: repoPath).transform((result) {
- if (!result.success) throw 'Git failed.';
- return null;
- });
+ return git.run(["checkout", ref], workingDir: repoPath).transform(
+ (result) => null);
}
/**
« no previous file with comments | « utils/pub/git.dart ('k') | utils/pub/pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698