Skip to content

Commit 93a183d

Browse files
committed
fix: Resolve Windows UNC path mismatch in worktree detection and clippy octal escape warnings
1 parent 2b40c2e commit 93a183d

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

crates/turborepo-config/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,10 @@ mod test {
871871
#[test]
872872
fn test_resolve_cache_dir_default_returns_relative_path() {
873873
let tmp_dir = TempDir::new().unwrap();
874-
let repo_root = AbsoluteSystemPathBuf::try_from(tmp_dir.path()).unwrap();
874+
let repo_root = AbsoluteSystemPathBuf::try_from(tmp_dir.path())
875+
.unwrap()
876+
.to_realpath()
877+
.unwrap();
875878

876879
// Initialize git repo
877880
std::process::Command::new("git")

crates/turborepo-scm/src/ls_tree.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ mod tests {
186186
// from git ls-tree output.
187187
#[test]
188188
fn test_ls_tree_sorted() {
189-
let input = "100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tpackage.json\0100644 \
190-
blob 5b999efa470b056e329b4c23a73904e0794bdc2f\tsrc/index.ts\0100644 blob \
189+
let input = "100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tpackage.json\x00100644 \
190+
blob 5b999efa470b056e329b4c23a73904e0794bdc2f\tsrc/index.ts\x00100644 blob \
191191
f44f57fff95196c5f7139dfa0b96875f1e9650a9\tsrc/utils.ts\0";
192192

193193
let expected = to_sorted_hashes(&[

crates/turborepo-scm/src/worktree.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,7 @@ impl WorktreeInfo {
5252
let worktree_root = repo
5353
.workdir()
5454
.ok_or_else(|| Error::git_error("bare repository has no workdir"))?;
55-
let worktree_root = AbsoluteSystemPathBuf::try_from(
56-
worktree_root
57-
.canonicalize()
58-
.map_err(|e| Error::git_error(format!("failed to canonicalize workdir: {e}")))?
59-
.as_path(),
60-
)?;
55+
let worktree_root = AbsoluteSystemPathBuf::try_from(worktree_root)?.to_realpath()?;
6156

6257
let git_common_dir = repo.commondir().to_string_lossy().to_string();
6358

0 commit comments

Comments
 (0)