Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic when working in -q mode with working directories created with git worktree #128

Open
nstetich opened this issue Nov 22, 2024 · 0 comments

Comments

@nstetich
Copy link

I work in a situation where I need to track multiple branches of multiple repositories and I use git worktree to create working directories without cloning the repository repeatedly.

When I attempt to run gitbatch -m pull -q in a directory containing working copy directories of git repositories that were created with git worktree add -b <BRANCH> <WORKING LOCATION> from the main cloned location, I see an error like the following:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x18 pc=0x10507eb70]

goroutine 37 [running]:
github.com/go-git/go-git/v5/plumbing.(*Reference).Hash(...)
        github.com/go-git/go-git/[email protected]/plumbing/reference.go:183
github.com/isacikgoz/gitbatch/internal/command.pullWithGit(0x14000214340, 0x140000a4ea0)
        github.com/isacikgoz/gitbatch/internal/command/pull.go:72 +0x230
github.com/isacikgoz/gitbatch/internal/command.Pull(0x1400016eaf0?, 0x43?)
        github.com/isacikgoz/gitbatch/internal/command/pull.go:47 +0x58
github.com/isacikgoz/gitbatch/internal/app.operate({0x1400016eaf0?, 0x0?}, {0x16b1a3444, 0x4})
        github.com/isacikgoz/gitbatch/internal/app/quick.go:43 +0x84
github.com/isacikgoz/gitbatch/internal/app.quick.func1({0x1400016eaf0, 0x43}, {0x16b1a3444, 0x4})
        github.com/isacikgoz/gitbatch/internal/app/quick.go:19 +0x60
created by github.com/isacikgoz/gitbatch/internal/app.quick in goroutine 1
        github.com/isacikgoz/gitbatch/internal/app/quick.go:17 +0x60

When I run gitbatch in interactive mode in the same directory, I simply don't see these working directories in the list of git projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant