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

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

Issue 341643002: Make short-running Git operations synchronous. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | « sdk/lib/_internal/pub/lib/src/io.dart ('k') | sdk/lib/_internal/pub/test/package_files_test.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/source/git.dart
diff --git a/sdk/lib/_internal/pub/lib/src/source/git.dart b/sdk/lib/_internal/pub/lib/src/source/git.dart
index b0488c4ebbe14d6413c5946fdb94f8ca3cc32fb3..c0aa95d668ce626d4b89d8fd206e79c2c232615c 100644
--- a/sdk/lib/_internal/pub/lib/src/source/git.dart
+++ b/sdk/lib/_internal/pub/lib/src/source/git.dart
@@ -51,16 +51,14 @@ class GitSource extends CachedSource {
var revisionCachePath;
- return git.isInstalled.then((installed) {
- if (!installed) {
- throw new ApplicationException(
- "Cannot get ${id.name} from Git (${_getUrl(id)}).\n"
- "Please ensure Git is correctly installed.");
- }
+ if (!git.isInstalled) {
+ throw new ApplicationException(
+ "Cannot get ${id.name} from Git (${_getUrl(id)}).\n"
+ "Please ensure Git is correctly installed.");
+ }
- ensureDir(path.join(systemCacheRoot, 'cache'));
- return _ensureRevision(id);
- }).then((_) => getDirectory(id)).then((path) {
+ ensureDir(path.join(systemCacheRoot, 'cache'));
+ return _ensureRevision(id).then((_) => getDirectory(id)).then((path) {
revisionCachePath = path;
if (entryExists(revisionCachePath)) return null;
return _clone(_repoCachePath(id), revisionCachePath, mirror: false);
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/io.dart ('k') | sdk/lib/_internal/pub/test/package_files_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698