Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## 0.22.14

- Fixes issue with local analysis without git repository root.
- Accept `logger` in `PackageAnalyzer.inspectDir` method.

## 0.22.13
Expand Down
16 changes: 10 additions & 6 deletions lib/src/package_analyzer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,16 @@ class PackageAnalyzer {
}

Future<String?> _detectGitRoot(String packageDir) async {
final pr = await runGitIsolated(
['rev-parse', '--show-toplevel'],
workingDirectory: packageDir,
);
if (pr.exitCode == 0) {
return pr.stdout.asString.trim();
try {
final pr = await runGitIsolated(
['rev-parse', '--show-toplevel'],
workingDirectory: packageDir,
);
if (pr.exitCode == 0) {
return pr.stdout.asString.trim();
}
} on GitToolException catch (_) {
// ignore exception
}
return null;
}
Expand Down