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

handle empty lineage entries gracefully #3453

Open
kevgo opened this issue Apr 26, 2024 · 0 comments
Open

handle empty lineage entries gracefully #3453

kevgo opened this issue Apr 26, 2024 · 0 comments
Labels

Comments

@kevgo
Copy link
Contributor

kevgo commented Apr 26, 2024

Steps to reproduce

  • have a lineage entry that is empty in either the branch or parent name
  • run any Git Town command

expected behavior: it deletes the invalid lineage entries

actual behavior: it crashes

Command output

panic: local branch names cannot be empty

goroutine 1 [running]:
github.com/git-town/git-town/v14/src/git/gitdomain.NewLocalBranchName(...)
        C:/Users/kevin/d/git-town/src/git/gitdomain/local_branch_name.go:16
github.com/git-town/git-town/v14/src/git/gitdomain.NewLocalBranchNames(...)
        C:/Users/kevin/d/git-town/src/git/gitdomain/local_branch_names.go:16
github.com/git-town/git-town/v14/src/git/gitdomain.ParseLocalBranchNames({0xc000268168?, 0xbc00000001756ca0?})
        C:/Users/kevin/d/git-town/src/git/gitdomain/local_branch_names.go:28 +0xc5
github.com/git-town/git-town/v14/src/config/gitconfig.AddKeyToPartialConfig({0x166ccdb, 0x1b}, {0xc000268168, 0xe}, 0xc000114f30)
        C:/Users/kevin/d/git-town/src/config/gitconfig/access.go:103 +0xe1f
github.com/git-town/git-town/v14/src/config/gitconfig.(*Access).load(_, _, _)
        C:/Users/kevin/d/git-town/src/config/gitconfig/access.go:256 +0x553
github.com/git-town/git-town/v14/src/config/gitconfig.(*Access).LoadLocal(...)
        C:/Users/kevin/d/git-town/src/config/gitconfig/access.go:33
github.com/git-town/git-town/v14/src/execute.OpenRepo({0x0, 0x0, 0x1, 0x1, 0x0, 0x0})
        C:/Users/kevin/d/git-town/src/execute/open_repo.go:47 +0x307
github.com/git-town/git-town/v14/src/cmd.executeSwitch(0x0, 0x0?)
        C:/Users/kevin/d/git-town/src/cmd/switch.go:38 +0x5f
github.com/git-town/git-town/v14/src/cmd.switchCmd.func1(0xc0001cc800?, {0x1cf2260?, 0x4?, 0x165a9a9?})
        C:/Users/kevin/d/git-town/src/cmd/switch.go:29 +0x47
github.com/spf13/cobra.(*Command).execute(0xc0001bdb00, {0x1cf2260, 0x0, 0x0})
        C:/Users/kevin/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:983 +0xabc
github.com/spf13/cobra.(*Command).ExecuteC(0xc000004300)
        C:/Users/kevin/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        C:/Users/kevin/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039
github.com/git-town/git-town/v14/src/cmd.Execute()
        C:/Users/kevin/d/git-town/src/cmd/core.go:38 +0x619

Additional information

No response

@kevgo kevgo added the bug label Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant