Panic - git worktree #37

Closed
opened 2025-09-19 10:50:33 +02:00 by simon · 2 comments
Collaborator

The only thing I can think of doing different than usual, is running murp on git worktree directory.

Caught panic:

runtime error: invalid memory address or nil pointer dereference

Restoring terminal...

goroutine 25 [running]:
runtime/debug.Stack()
        /nix/store/rv9g1p18w52vip6652svdgy138wgx7dj-go-1.24.2/share/go/src/runtime/debug/stack.go:26 +0x5e
runtime/debug.PrintStack()
        /nix/store/rv9g1p18w52vip6652svdgy138wgx7dj-go-1.24.2/share/go/src/runtime/debug/stack.go:18 +0x13
github.com/charmbracelet/bubbletea.(*Program).recoverFromPanic(0xc0002fa000)
        /home/simon/go/pkg/mod/github.com/charmbracelet/bubbletea@v1.3.4/tea.go:758 +0x8b
panic({0xbf5d20?, 0x13fdcc0?})
        /nix/store/rv9g1p18w52vip6652svdgy138wgx7dj-go-1.24.2/share/go/src/runtime/panic.go:792 +0x132
0xee.cc/smgt/murp/internal/project.(*Project).setProject(0xc0002e45d0)
        /home/simon/code/readly/murp/internal/project/project.go:133 +0x4e
0xee.cc/smgt/murp/internal/project.Open({0xe73b70, 0x1})
        /home/simon/code/readly/murp/internal/project/project.go:228 +0xf6
0xee.cc/smgt/murp/internal/app.(*MergeRequestCmd).BeforeAction.func1({0x0?, 0x0?})
        /home/simon/code/readly/murp/internal/app/mergerequest.go:222 +0x30
github.com/charmbracelet/huh/spinner.(*Spinner).Init.func1()
        /home/simon/go/pkg/mod/github.com/charmbracelet/huh/spinner@v0.0.0-20250410174039-76d1f8226680/spinner.go:130 +0x31
github.com/charmbracelet/bubbletea.(*Program).handleCommands.func1.1()
        /home/simon/go/pkg/mod/github.com/charmbracelet/bubbletea@v1.3.4/tea.go:352 +0x7d
created by github.com/charmbracelet/bubbletea.(*Program).handleCommands.func1 in goroutine 22
        /home/simon/go/pkg/mod/github.com/charmbracelet/bubbletea@v1.3.4/tea.go:346 +0x131
FATA program was killed: context canceled
The only thing I can think of doing different than usual, is running murp on git worktree directory. ``` Caught panic: runtime error: invalid memory address or nil pointer dereference Restoring terminal... goroutine 25 [running]: runtime/debug.Stack() /nix/store/rv9g1p18w52vip6652svdgy138wgx7dj-go-1.24.2/share/go/src/runtime/debug/stack.go:26 +0x5e runtime/debug.PrintStack() /nix/store/rv9g1p18w52vip6652svdgy138wgx7dj-go-1.24.2/share/go/src/runtime/debug/stack.go:18 +0x13 github.com/charmbracelet/bubbletea.(*Program).recoverFromPanic(0xc0002fa000) /home/simon/go/pkg/mod/github.com/charmbracelet/bubbletea@v1.3.4/tea.go:758 +0x8b panic({0xbf5d20?, 0x13fdcc0?}) /nix/store/rv9g1p18w52vip6652svdgy138wgx7dj-go-1.24.2/share/go/src/runtime/panic.go:792 +0x132 0xee.cc/smgt/murp/internal/project.(*Project).setProject(0xc0002e45d0) /home/simon/code/readly/murp/internal/project/project.go:133 +0x4e 0xee.cc/smgt/murp/internal/project.Open({0xe73b70, 0x1}) /home/simon/code/readly/murp/internal/project/project.go:228 +0xf6 0xee.cc/smgt/murp/internal/app.(*MergeRequestCmd).BeforeAction.func1({0x0?, 0x0?}) /home/simon/code/readly/murp/internal/app/mergerequest.go:222 +0x30 github.com/charmbracelet/huh/spinner.(*Spinner).Init.func1() /home/simon/go/pkg/mod/github.com/charmbracelet/huh/spinner@v0.0.0-20250410174039-76d1f8226680/spinner.go:130 +0x31 github.com/charmbracelet/bubbletea.(*Program).handleCommands.func1.1() /home/simon/go/pkg/mod/github.com/charmbracelet/bubbletea@v1.3.4/tea.go:352 +0x7d created by github.com/charmbracelet/bubbletea.(*Program).handleCommands.func1 in goroutine 22 /home/simon/go/pkg/mod/github.com/charmbracelet/bubbletea@v1.3.4/tea.go:346 +0x131 FATA program was killed: context canceled ```
Owner

Yea, I saw this. It happened to me when trying to run murp in a project where it could not figure out the remote.

Yea, I saw this. It happened to me when trying to run murp in a project where it could not figure out the remote.
Owner

Getting remotes in git worktree is not trivial. Since it seems that when using a worktree there isn't a .git directory, just a file called .git with information about the parent worktree. I need to test this feature a lot before I can merge a solution (#39).

Getting remotes in `git worktree` is not trivial. Since it seems that when using a worktree there isn't a `.git` directory, just a file called `.git` with information about the parent worktree. I need to test this feature a lot before I can merge a solution (#39).
smgt closed this issue 2026-02-18 12:09:11 +01:00
Sign in to join this conversation.
No labels
bug
feature
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
smgt/murp#37
No description provided.