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

Unified Diff: utils/tests/pub/pub_install_git_test.dart

Issue 10913077: Use a bare git repository for the repo cache. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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
Index: utils/tests/pub/pub_install_git_test.dart
diff --git a/utils/tests/pub/pub_install_git_test.dart b/utils/tests/pub/pub_install_git_test.dart
index 1c98af149b38b245d4717c5ef9da4306254642bc..56292f76d2b87457c0388a9627ec671c88227d21 100644
--- a/utils/tests/pub/pub_install_git_test.dart
+++ b/utils/tests/pub/pub_install_git_test.dart
@@ -24,8 +24,8 @@ main() {
dir(cachePath, [
dir('git', [
- dir('cache', [gitPackageCacheDir('foo')]),
- gitPackageCacheDir('foo')
+ dir('cache', [gitPackageRepoCacheDir('foo')]),
+ gitPackageRevisionCacheDir('foo')
])
]).scheduleValidate();
@@ -58,11 +58,11 @@ main() {
dir(cachePath, [
dir('git', [
dir('cache', [
- gitPackageCacheDir('foo'),
- gitPackageCacheDir('bar')
+ gitPackageRepoCacheDir('foo'),
+ gitPackageRepoCacheDir('bar')
]),
- gitPackageCacheDir('foo'),
- gitPackageCacheDir('bar')
+ gitPackageRevisionCacheDir('foo'),
+ gitPackageRevisionCacheDir('bar')
])
]).scheduleValidate();
@@ -118,8 +118,8 @@ main() {
dir(cachePath, [
dir('git', [
- dir('cache', [gitPackageCacheDir('foo')]),
- gitPackageCacheDir('foo')
+ dir('cache', [gitPackageRepoCacheDir('foo')]),
+ gitPackageRevisionCacheDir('foo')
])
]).scheduleValidate();
@@ -144,9 +144,9 @@ main() {
// git/cache directory but create a new git/ directory.
dir(cachePath, [
dir('git', [
- dir('cache', [gitPackageCacheDir('foo', 2)]),
- gitPackageCacheDir('foo'),
- gitPackageCacheDir('foo', 2)
+ dir('cache', [gitPackageRepoCacheDir('foo')]),
+ gitPackageRevisionCacheDir('foo'),
+ gitPackageRevisionCacheDir('foo', 2)
])
]).scheduleValidate();
@@ -173,8 +173,8 @@ main() {
dir(cachePath, [
dir('git', [
- dir('cache', [gitPackageCacheDir('foo')]),
- gitPackageCacheDir('foo')
+ dir('cache', [gitPackageRepoCacheDir('foo')]),
+ gitPackageRevisionCacheDir('foo')
])
]).scheduleValidate();
@@ -222,6 +222,33 @@ main() {
run();
});
+ test('checks out a package at a specific branch from Git', () {
+ ensureGit();
+
+ var repo = git('foo.git', [
+ file('foo.dart', 'main() => "foo 1";')
+ ]);
+ repo.scheduleCreate();
+ repo.scheduleGit(["branch", "old"]);
+
+ git('foo.git', [
+ file('foo.dart', 'main() => "foo 2";')
+ ]).scheduleCommit();
+
+ appDir([{"git": {"url": "../foo.git", "ref": "old"}}]).scheduleCreate();
+
+ schedulePub(args: ['install'],
+ output: const RegExp(@"Dependencies installed!$"));
+
+ dir(packagesPath, [
+ dir('foo', [
+ file('foo.dart', 'main() => "foo 1";')
+ ])
+ ]).scheduleValidate();
+
+ run();
+ });
+
test('keeps a Git package locked to the version in the lockfile', () {
ensureGit();
@@ -352,8 +379,8 @@ main() {
dir(cachePath, [
dir('git', [
- dir('cache', [gitPackageCacheDir('foo')]),
- gitPackageCacheDir('foo')
+ dir('cache', [gitPackageRepoCacheDir('foo')]),
+ gitPackageRevisionCacheDir('foo')
])
]).scheduleValidate();

Powered by Google App Engine
This is Rietveld 408576698