From 3d9f1e02e5063e1ce24f4b9122963eaef64b7262 Mon Sep 17 00:00:00 2001 From: John Whitley Date: Sun, 24 Dec 2023 08:46:02 -0800 Subject: Refactor repo_paths.go to use git rev-parse This changes GetRepoPaths() to pull information from `git rev-parse` instead of effectively reimplementing git's logic for pathfinding. This change fixes issues with bare repos, esp. versioned homedir use cases, by aligning lazygit's path handling to what git itself does. This change also enables lazygit to run from arbitrary subdirectories of a repository, including correct handling of symlinks, including "deep" symlinks into a repo, worktree, a repo's submodules, etc. Integration tests are now resilient against unintended side effects from the host's environment variables. Of necessity, $PATH and $TERM are the only env vars allowed through now. --- test/.gitconfig | 1 + 1 file changed, 1 insertion(+) create mode 120000 test/.gitconfig (limited to 'test') diff --git a/test/.gitconfig b/test/.gitconfig new file mode 120000 index 000000000..b2405f3cd --- /dev/null +++ b/test/.gitconfig @@ -0,0 +1 @@ +global_git_config \ No newline at end of file -- cgit v1.2.3