summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests/worktree
AgeCommit message (Collapse)Author
2024-01-25Support range select for staging/discarding filesJesse Duffield
As part of this, you must now press enter on a merge conflict file to focus the merge view; you can no longer press space and if you do it will raise an error.
2024-01-24Refactor repo_paths.go to use git rev-parseJohn Whitley
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.
2024-01-12Set working directory in lazygit test commandJesse Duffield
We need to fetch our list of tests both outside of our test binary and within. We need to get the list from within so that we can run the code that drives the test and runs assertions. To get the list of tests we need to know where the root of the lazygit repo is, given that the tests live in files under that root. So far, we've used this GetLazyRootDirectory() function for that, but it assumes that we're not in a test directory (it just looks for the first .git dir it can find). Because we didn't want to properly fix this before, we've been setting the working directory of the test command to the lazygit root, and using the --path CLI arg to override it when the test itself ran. This was a terrible hack. Now, we're passing the lazygit root directory as an env var to the integration test, so that we can set the working directory to the actual path of the test repo; removing the need to use the --path arg.
2023-08-10Allow deleting remote tags/branches from local tag/branch views (#2738)Federico
2023-08-07Support bare worktrees where worktree does not have its own .git fileJesse Duffield
This was on oversight on my part: I assumed that the --work-tree arg was always intended for use with linked worktrees which have a .git file pointing back to the repo. I'm honestly confused now: seems like there are three kinds of worktrees: * the main worktree of a non-bare repo * a linked worktree (with its own gitdir in the repo's worktrees/ dir) * a random folder which you specify as a worktree with the --work-tree arg I'm pretty sure the --work-tree arg is only intended to be used with this third kind or workree
2023-08-07Test bare repos with dotfile setupJesse Duffield
2023-07-30Fix flakey worktree testsJesse Duffield
In the presentation layer, when showing branches, we'll show worktrees against branches if they're associated. But there was a race condition: if the worktree model was refreshed after the branches model, it wouldn't be used in the presentation layer when it came time to render the branches. A better solution would be to have some way of signalling that a particular context needs to be refreshed and after all the models are done being refreshed, we then refresh the contexts. This will prevent double-renders
2023-07-30Fix bug where worktree view would take over window upon switching branchesJesse Duffield
When switching worktrees (which we can now do via the branch view) we re-layout the windows and their views. We had the worktree view ahead of the file view based on the Flatten() method in context.go, because it used to be associated with the branches panel.
2023-07-30Centralise logic for obtaining repo pathsJesse Duffield
There are quite a few paths you might want to get e.g. the repo's path, the worktree's path, the repo's git dir path, the worktree's git dir path. I want these all obtained once and then used when needed rather than having to have IO whenever we need them. This is not so much about reducing time spent on IO as it is about not having to care about errors every time we want a path.
2023-07-30Add test for opening lazygit in the worktree of a bare repoJesse Duffield
2023-07-30Update repo switch logicJesse Duffield
We now always re-use the state of the repo if we're returning to it, and we always reset the windows to their default tabs. We reset to default tabs because it's easy to implement. If people want to: * have tab states be retained when switching * have tab states specific to the current repo retained when switching back Then we'll need to revisit this
2023-07-30Add test for retained context focus when switching worktreesJesse Duffield
2023-07-30Support fastforwarding worktreeJesse Duffield
2023-07-30Add more worktree testsJesse Duffield
2023-07-30Add worktree tests for removing/detachingJesse Duffield
2023-07-30Add worktree integration testsJesse Duffield