Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions lib/src/source/git.dart
Original file line number Diff line number Diff line change
Expand Up @@ -772,8 +772,9 @@ class GitSource extends CachedSource {
'--list',
'--format',
// We can use space here, as it is not allowed in a git tag
// https://git-scm.com/docs/git-check-ref-format
'%(refname:lstrip=2) %(objectname)',
// https://git-scm.com/docs/git-check-ref-format The `*` means we list the
// hash of the tagged object, not the tag itself.
'%(refname:lstrip=2) %(*objectname)',
], workingDir: path);
final lines = output.trim().split('\n');
final result = <TaggedVersion>[];
Expand Down
58 changes: 58 additions & 0 deletions test/get/git/tag_pattern_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -379,4 +379,62 @@ void main() {
});
},
);

test(
'Multiple path dependencies to same package work (regression https://github.com/dart-lang/pub/issues/4706)',
() async {
await d.git('foo.git', [
d.dir('one', [
d.libPubspec(
'one',
'1.0.0',
sdk: '^3.9.0',
deps: {
'two': {'path': '../two'},
'three': {'path': '../three'},
},
),
]),
d.dir('two', [
d.libPubspec(
'two',
'1.0.0',
sdk: '^3.9.0',
deps: {
'three': {'path': '../three'},
},
),
]),
d.dir('three', [d.libPubspec('three', '1.0.0', sdk: '^3.9.0')]),
]).create();
await d.git('foo.git', []).tag('1.0.0');

await d
.appDir(
dependencies: {
'one': {
'git': {
'url': '../foo.git',
'path': 'one',
'tag_pattern': '{{version}}',
},
'version': '^1.0.0',
},
},
pubspec: {
'environment': {'sdk': '^3.9.0'},
},
)
.create();

await pubGet(
output: allOf(
contains('+ one 1.0.0'),
contains('+ two 1.0.0'),
contains('+ three 1.0.0'),
),
environment: {'_PUB_TEST_SDK_VERSION': '3.9.0'},
);
},
);
}