legit

Fork of https://git.icyphox.sh/legit

Use os.Root for path checking os.Root uses system primitive rather than stringy securejoin. Ideally, git.Open should accept fs.FS (or *os.Root) but go-git in its current form (even v6) does not expose a function for "smart" open method that can open both bare and non-bare repositories. This patch also accidentally fixes following bugs: * checked out "description" file in a non-bare repository is treated as a description file. * ignored repository reveal using URL-encoded slashes (see the second test added in the parent commit) Load tests on a minimal setup (nix run .#testing) shows no differences before and after this patch. This is not a clean solution, but code is less duplicated and more correct and secure. I may revisit and refactor in near future.

Changes

14 changed files (+141/-157)