Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

refactor: fix diagnostic log location docs and remove wrapper function (#812)

Maximilian Roosa6366dd42da0
diff --git a/src/diagnostic.rs b/src/diagnostic.rs
index ac70f14f8..0dd25d67e 100644
--- a/src/diagnostic.rs
+++ b/src/diagnostic.rs
@@ -30,8 +30,8 @@
//!
//! # File Location
//!
-//! Reports are written to `.git/wt-logs/diagnostic.md` in the main worktree.
-//! Verbose logs go to `.git/wt-logs/verbose.log`.
+//! Reports are written to `<git-common-dir>/wt-logs/diagnostic.md` (typically
+//! `.git/wt-logs/diagnostic.md`). Verbose logs go to `verbose.log` in the same directory.
//!
//! # Usage
//!
@@ -194,7 +194,10 @@ impl DiagnosticReport {
}
/// Write the diagnostic report to a file.
- fn write_file(&self, repo: &Repository) -> Option<PathBuf> {
+ ///
+ /// Called from `write_if_verbose()` when verbose >= 2.
+ /// Returns the path if successful, None if write failed.
+ pub fn write_diagnostic_file(&self, repo: &Repository) -> Option<PathBuf> {
let log_dir = repo.wt_logs_dir();
std::fs::create_dir_all(&log_dir).ok()?;
@@ -203,14 +206,6 @@ impl DiagnosticReport {
Some(path)
}
-
- /// Write the diagnostic report to a file (for -vv flag).
- ///
- /// Called from `write_if_verbose()` when verbose >= 2.
- /// Returns the path if successful, None if write failed.
- pub fn write_diagnostic_file(&self, repo: &Repository) -> Option<PathBuf> {
- self.write_file(repo)
- }
}
/// Return hint telling users to run with `-vv` for diagnostics.
diff --git a/src/git/repository/mod.rs b/src/git/repository/mod.rs
index cafc54bd0..55ccf7c6f 100644
--- a/src/git/repository/mod.rs
+++ b/src/git/repository/mod.rs
@@ -308,8 +308,7 @@ impl Repository {
/// Get the directory where worktrunk background logs are stored.
///
- /// Logs are centralized under the main worktree's git directory:
- /// `.git/wt-logs/`.
+ /// Returns `<git-common-dir>/wt-logs/` (typically `.git/wt-logs/`).
pub fn wt_logs_dir(&self) -> PathBuf {
self.git_common_dir().join("wt-logs")
}