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

Side by Side Diff: utils/pub/git_source.dart

Issue 11361158: Revert "Pass absolute path to git (redux)." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | utils/pub/io.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library git_source; 5 library git_source;
6 6
7 import 'git.dart' as git; 7 import 'git.dart' as git;
8 import 'io.dart'; 8 import 'io.dart';
9 import 'package.dart'; 9 import 'package.dart';
10 import 'source.dart'; 10 import 'source.dart';
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 141 }
142 142
143 /** 143 /**
144 * Clones the repo at the URI [from] to the path [to] on the local filesystem. 144 * Clones the repo at the URI [from] to the path [to] on the local filesystem.
145 * 145 *
146 * If [mirror] is true, create a bare, mirrored clone. This doesn't check out 146 * If [mirror] is true, create a bare, mirrored clone. This doesn't check out
147 * the working tree, but instead makes the repository a local mirror of the 147 * the working tree, but instead makes the repository a local mirror of the
148 * remote repository. See the manpage for `git clone` for more information. 148 * remote repository. See the manpage for `git clone` for more information.
149 */ 149 */
150 Future _clone(String from, String to, {bool mirror: false}) { 150 Future _clone(String from, String to, {bool mirror: false}) {
151 // TODO(rnystrom): For some mysterious reason, the Windows buildbots do not
152 // have the right working directory when pub spawns git, so the relative
153 // path fails. To work around it, just always pass in a full path. Should
154 // figure out what's going on here.
155 from = getFullPath(from);
156
157 // Git on Windows does not seem to automatically create the destination 151 // Git on Windows does not seem to automatically create the destination
158 // directory. 152 // directory.
159 return ensureDir(to).chain((_) { 153 return ensureDir(to).chain((_) {
160 var args = ["clone", from, to]; 154 var args = ["clone", from, to];
161 if (mirror) args.insertRange(1, 1, "--mirror"); 155 if (mirror) args.insertRange(1, 1, "--mirror");
162 return git.run(args); 156 return git.run(args);
163 }).transform((result) => null); 157 }).transform((result) => null);
164 } 158 }
165 159
166 /** 160 /**
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 217
224 /** 218 /**
225 * Returns [description] if it's a description, or [PackageId.description] if 219 * Returns [description] if it's a description, or [PackageId.description] if
226 * it's a [PackageId]. 220 * it's a [PackageId].
227 */ 221 */
228 _getDescription(description) { 222 _getDescription(description) {
229 if (description is PackageId) return description.description; 223 if (description is PackageId) return description.description;
230 return description; 224 return description;
231 } 225 }
232 } 226 }
OLDNEW
« no previous file with comments | « no previous file | utils/pub/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698