configure method
void
configure({
- String? gitExe,
- String getCwd()?,
- String? findGitRoot()?,
- String? findCanonicalGitRoot()?,
- Future<
String> getDefaultBranch()?, - Future<
String> getBranch()?, - void saveProjectConfig()?,
- Future<
({String worktreePath})> executeWorktreeCreateHook()?, - Future<
bool> executeWorktreeRemoveHook()?, - bool hasWorktreeCreateHook()?,
- Future<
String?> readWorktreeHeadSha()?, - void logForDebugging(})?,
Implementation
void configure({
String? gitExe,
String Function()? getCwd,
String? Function(String)? findGitRoot,
String? Function(String)? findCanonicalGitRoot,
Future<String> Function()? getDefaultBranch,
Future<String> Function()? getBranch,
void Function(WorktreeSession?)? saveProjectConfig,
Future<({String worktreePath})> Function(String)? executeWorktreeCreateHook,
Future<bool> Function(String)? executeWorktreeRemoveHook,
bool Function()? hasWorktreeCreateHook,
Future<String?> Function(String)? readWorktreeHeadSha,
void Function(String, {String? level})? logForDebugging,
}) {
if (gitExe != null) _gitExe = gitExe;
if (getCwd != null) _getCwd = getCwd;
if (findGitRoot != null) _findGitRoot = findGitRoot;
if (findCanonicalGitRoot != null) {
_findCanonicalGitRoot = findCanonicalGitRoot;
}
if (getDefaultBranch != null) _getDefaultBranch = getDefaultBranch;
if (getBranch != null) _getBranch = getBranch;
if (saveProjectConfig != null) onSaveProjectConfig = saveProjectConfig;
if (executeWorktreeCreateHook != null) {
onExecuteWorktreeCreateHook = executeWorktreeCreateHook;
}
if (executeWorktreeRemoveHook != null) {
onExecuteWorktreeRemoveHook = executeWorktreeRemoveHook;
}
if (hasWorktreeCreateHook != null) {
_hasWorktreeCreateHook = hasWorktreeCreateHook;
}
if (readWorktreeHeadSha != null) {
_readWorktreeHeadSha = readWorktreeHeadSha;
}
if (logForDebugging != null) _logForDebugging = logForDebugging;
}