Fix git staging in a subfolder (#37860)

Closes #37418 

Ideal fix for this would be #37855 but that is a large refactor so
implementing this as a workaround.

Release Notes:

- N/A
This commit is contained in:
localcc
2025-09-09 16:50:26 +00:00
committed by GitHub
parent 8527dcfc65
commit f397294640
+4 -2
View File
@@ -4777,8 +4777,10 @@ impl BackgroundScanner {
.git_repositories
.iter()
.find_map(|(_, repo)| {
if repo.common_dir_abs_path.as_ref() == &dot_git_dir
|| repo.repository_dir_abs_path.as_ref() == &dot_git_dir
let dot_git_dir = SanitizedPath::new(&dot_git_dir);
if SanitizedPath::new(repo.common_dir_abs_path.as_ref()) == dot_git_dir
|| SanitizedPath::new(repo.repository_dir_abs_path.as_ref())
== dot_git_dir
{
Some(repo.clone())
} else {