Summary
Two isGitRepo findings from the LLD review of backend/internal/service/project/service.go were split out of #95 (PR #96) and deferred. This issue tracks them.
1. [Medium] isGitRepo case-sensitivity bug on Linux
if strings.EqualFold(top, path) {
return true
}
return top == path
On case-sensitive filesystems (Linux), EqualFold will wrongly treat /home/user/MyRepo and /home/user/myrepo as the same path.
Fix: Drop the EqualFold branch and rely on == after filepath.EvalSymlinks on all platforms, or gate the case-insensitive compare behind a runtime.GOOS check (darwin/windows only).
backend/internal/service/project/service.go (isGitRepo)
2. [Medium] isGitRepo is untestable — shells out with no seam
isGitRepo calls exec.Command("git", ...) directly, so project.Service cannot be tested without a real filesystem and a real git binary.
Fix: Put the git check behind a GitChecker interface injected into Service (real impl shells out, fake for tests).
backend/internal/service/project/service.go
Acceptance criteria
Split out of #95 / PR #96 to keep that PR focused. An implementation existed in PR #96 and was reverted in commit e3d2533 — it can serve as a starting point.
Summary
Two
isGitRepofindings from the LLD review ofbackend/internal/service/project/service.gowere split out of #95 (PR #96) and deferred. This issue tracks them.1. [Medium]
isGitRepocase-sensitivity bug on LinuxOn case-sensitive filesystems (Linux),
EqualFoldwill wrongly treat/home/user/MyRepoand/home/user/myrepoas the same path.Fix: Drop the
EqualFoldbranch and rely on==afterfilepath.EvalSymlinkson all platforms, or gate the case-insensitive compare behind aruntime.GOOScheck (darwin/windows only).backend/internal/service/project/service.go(isGitRepo)2. [Medium]
isGitRepois untestable — shells out with no seamisGitRepocallsexec.Command("git", ...)directly, soproject.Servicecannot be tested without a real filesystem and a real git binary.Fix: Put the git check behind a
GitCheckerinterface injected intoService(real impl shells out, fake for tests).backend/internal/service/project/service.goAcceptance criteria
isGitRepocorrect on case-sensitive filesystemsSplit out of #95 / PR #96 to keep that PR focused. An implementation existed in PR #96 and was reverted in commit e3d2533 — it can serve as a starting point.