Skip to content

Commit

Permalink
Fix cloning from local repo
Browse files Browse the repository at this point in the history
  • Loading branch information
passsy committed Mar 5, 2024
1 parent cde6ca4 commit 9180d4d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/test/install_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,31 @@ void main() {
bool _precached = false;
Lock precacheLock = Lock();

/// Allow to clone from file system to speed up tests
Future<void> allowCloneFromFile() async {
// get current allow setting
String? allowValue;
try {
allowValue = await output('git config --global protocol.file.allow');
} catch (e) {
// ignore, not set
}
print('allowValue: "$allowValue"');
if (allowValue?.trim() != 'always') {
await run('git config --global protocol.file.allow always');

// always restore to previous value
addTearDown(() {
run('git config --global protocol.file.allow $allowValue');
});
}
}

Future<void> runInstallScript({
required String appDir,
required String gitRootDir,
}) async {
await allowCloneFromFile();
const fs = LocalFileSystem();
final repoRoot = fs.currentDirectory.parent;
// Get path from line
Expand Down

0 comments on commit 9180d4d

Please sign in to comment.