Skip to content
Open
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
1 change: 1 addition & 0 deletions lib/src/cli/git_cli.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Git {
try {
await _Cmd.run('git', [
'ls-remote',
'--get-url',
'$remote',
'--exit-code',
], logger: logger);
Expand Down
16 changes: 16 additions & 0 deletions test/src/cli/git_cli_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,22 @@ void main() {
}, runProcess: process.run);
});

test('passes --get-url to respect insteadOf overrides', () async {
final remote = Uri.parse('https://github.com/org/repo');
await ProcessOverrides.runZoned(() async {
await Git.reachable(remote, logger: logger);
}, runProcess: process.run);

verify(
() => process.run(
'git',
['ls-remote', '--get-url', '$remote', '--exit-code'],
runInShell: any(named: 'runInShell'),
workingDirectory: any(named: 'workingDirectory'),
),
).called(1);
});

test(
'throws UnreachableGitDependency for an unreachable remote',
() async {
Expand Down
Loading