Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/src/command/dependency_services.dart
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class DependencyServicesListCommand extends PubCommand {
extension on PackageId {
String versionOrHash() {
final description = this.description;
if (description is GitResolvedDescription) {
if (description is ResolvedGitDescription) {
return description.resolvedRef;
} else {
return version.toString();
Expand Down
22 changes: 11 additions & 11 deletions lib/src/source/git.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class GitSource extends CachedSource {
return PackageId(
name,
version,
GitResolvedDescription(
ResolvedGitDescription(
GitDescription(
url: url,
ref: ref,
Expand Down Expand Up @@ -229,7 +229,7 @@ class GitSource extends CachedSource {
await _ensureRepoCache(description, cache);
var path = _repoCachePath(description, cache);
var revision = await _firstRevision(path, description.ref);
final resolvedDescription = GitResolvedDescription(description, revision);
final resolvedDescription = ResolvedGitDescription(description, revision);

return Pubspec.parse(
await _showFileAtRevision(resolvedDescription, 'pubspec.yaml', cache),
Expand All @@ -243,7 +243,7 @@ class GitSource extends CachedSource {
/// Assumes that revision is present in the cache already (can be done with
/// [_ensureRevision]).
Future<String> _showFileAtRevision(
GitResolvedDescription resolvedDescription,
ResolvedGitDescription resolvedDescription,
String pathInProject,
SystemCache cache,
) async {
Expand Down Expand Up @@ -292,7 +292,7 @@ class GitSource extends CachedSource {
PackageId(
ref.name,
pubspec.version,
GitResolvedDescription(description, revision),
ResolvedGitDescription(description, revision),
),
];
});
Expand All @@ -303,7 +303,7 @@ class GitSource extends CachedSource {
@override
Future<Pubspec> describeUncached(PackageId id, SystemCache cache) {
final description = id.description;
if (description is! GitResolvedDescription) {
if (description is! ResolvedGitDescription) {
throw StateError('Called with wrong ref');
}
return _pool.withResource(
Expand All @@ -330,7 +330,7 @@ class GitSource extends CachedSource {

return Pubspec.parse(
await _showFileAtRevision(
GitResolvedDescription(description, revision),
ResolvedGitDescription(description, revision),
'pubspec.yaml',
cache,
),
Expand Down Expand Up @@ -370,7 +370,7 @@ class GitSource extends CachedSource {

ensureDir(p.join(cache.rootDirForSource(this), 'cache'));
final resolvedRef =
(id.description as GitResolvedDescription).resolvedRef;
(id.description as ResolvedGitDescription).resolvedRef;

didUpdate |= await _ensureRevision(description, resolvedRef, cache);

Expand Down Expand Up @@ -702,7 +702,7 @@ class GitSource extends CachedSource {

String _revisionCachePath(PackageId id, SystemCache cache) => p.join(
cache.rootDirForSource(this),
'${_repoName(id.description.description as GitDescription)}-${(id.description as GitResolvedDescription).resolvedRef}',
'${_repoName(id.description.description as GitDescription)}-${(id.description as ResolvedGitDescription).resolvedRef}',
);

/// Returns the path to the canonical clone of the repository referred to by
Expand Down Expand Up @@ -835,13 +835,13 @@ class GitDescription extends Description {
}
}

class GitResolvedDescription extends ResolvedDescription {
class ResolvedGitDescription extends ResolvedDescription {
@override
GitDescription get description => super.description as GitDescription;

final String resolvedRef;

GitResolvedDescription(GitDescription super.description, this.resolvedRef);
ResolvedGitDescription(GitDescription super.description, this.resolvedRef);

@override
String format() {
Expand Down Expand Up @@ -869,7 +869,7 @@ class GitResolvedDescription extends ResolvedDescription {

@override
bool operator ==(Object other) {
return other is GitResolvedDescription &&
return other is ResolvedGitDescription &&
other.description == description &&
other.resolvedRef == resolvedRef;
}
Expand Down
2 changes: 1 addition & 1 deletion test/get/git/ssh_url_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void main() {
'path': 'abc/',
},
);
final resolvedDescription = GitResolvedDescription(
final resolvedDescription = ResolvedGitDescription(
description,
'7d48f902b0326fc2ce0615c20f1aab6c811fe55b',
);
Expand Down