jesseduffield / jesseduffield/lazygit
Lazygit hangs after branch checkout command due to interactive git hook
- Dominant language
- Go
- Stars
- 82.4k
- Forks
- 3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 19
Description
**Describe the bug**
Lazygit hangs in `checking out` state when there is interactive `post-checkout` git hook
**To Reproduce**
Steps to reproduce the behavior:
1. Setup a git repository with an interactive post-checkout hook
```sh
echo 'exec .git/hooks/post-checkout
chmod u+x .git/hook/post-checkout
```
2. Open lazygit, and go to 'Branches' pane
3. Checkout branch
4. Lazygit hangs in 'Checking out' the branch
**Expected behavior**
Lazygit shouldn't hang on checkout, possible behaviors:
1. provide user control to interact with the git hook stdin.
2. terminate the git hook once checkout is done.
**Screenshots**
Status 'Checking out' doesn't change
**Version info:**
Lazygit: commit=, build date=, build source=nix, version=0.41.0, os=darwin, arch=arm64, git version=2.44.0
**Additional context**
I saw how you handle credential requests [sync.go#Pull](https://github.com/jesseduffield/lazygit/blob/618fe533f8c6113392eea981d03c65e6da5860bb/pkg/commands/git_commands/sync.go#L102), maybe it would make sense to give user access to stdin when a command is interactive as in edit command.
Contributor guide
Assessment
This issue has not been assessed yet.