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

Unified Diff: utils/pub/git_source.dart

Issue 11076004: Create destination directory before git cloning into it. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « no previous file | no next file » | 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 e0737e8e02c795679683f21e30f165a3ea8e4581..ca3bb712ef1af6a566a59ff19707c29036b27040 100644
--- a/utils/pub/git_source.dart
+++ b/utils/pub/git_source.dart
@@ -153,9 +153,13 @@ class GitSource extends Source {
* remote repository. See the manpage for `git clone` for more information.
*/
Future _clone(String from, String to, [bool mirror=false]) {
- var args = ["clone", from, to];
- if (mirror) args.insertRange(1, 1, "--mirror");
- return runGit(args).transform((result) {
+ // Git on Windows does not seem to automatically create the destination
+ // directory.
+ 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;
});
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698