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

dolt branch -d can't delete remote branches #1992

Open
jptheepic opened this issue Aug 10, 2021 · 1 comment
Open

dolt branch -d can't delete remote branches #1992

jptheepic opened this issue Aug 10, 2021 · 1 comment

Comments

@jptheepic
Copy link

@jptheepic jptheepic commented Aug 10, 2021

I am running into an error when trying to remove a remote branch.

Reproduce

mkdir project
mkdir my_remote
cd project
dolt init
dolt remote add my_remote file://<path to my_remote>
dolt push --set-upstream my_remote master
dolt checkout -b mybranch
dolt push --set-upstream my_remote mybranch
rm -r .dolt
dolt clone file://<path to my_remote> .
dolt branch -r 
dolt branch -dr mybranch

Expected result

The remote branch is deleted

Error received

panic: runtime error: slice bounds out of range [9:8]

goroutine 1 [running]:
github.com/dolthub/dolt/go/libraries/doltcore/ref.NewRemoteRefFromPathStr(0xc0000340d8, 0x8, 0x10, 0x7c4de5, 0x204c664, 0x204ce2c)
        /src/libraries/doltcore/ref/remote_ref.go:80 +0x368
github.com/dolthub/dolt/go/libraries/doltcore/env/actions.DeleteBranch(0x2330660, 0xc00052e3f0, 0xc0004ba630, 0xc0000340d8, 0x8, 0xc000870100, 0xc00007e060, 0x2)
        /src/libraries/doltcore/env/actions/branch.go:99 +0x305
github.com/dolthub/dolt/go/cmd/dolt/commands.handleDeleteBranches(0x2330660, 0xc00052e3f0, 0xc0004ba630, 0xc00052f110, 0xc000188540, 0xc00052f100, 0x2ef4460)
        /src/cmd/dolt/commands/branch.go:288 +0x10d
github.com/dolthub/dolt/go/cmd/dolt/commands.deleteBranches(...)
        /src/cmd/dolt/commands/branch.go:273
github.com/dolthub/dolt/go/cmd/dolt/commands.BranchCmd.Exec(0x2330660, 0xc00052e3f0, 0xc000206800, 0xb, 0xc00007e060, 0x2, 0x2, 0xc0004ba630, 0xb)
        /src/cmd/dolt/commands/branch.go:125 +0x5a7
github.com/dolthub/dolt/go/cmd/dolt/cli.SubCommandHandler.Exec(0x2049d11, 0x4, 0x2060dd7, 0x11, 0xc0008f7400, 0x27, 0x27, 0x0, 0x2330660, 0xc00052e3f0, ...)
        /src/cmd/dolt/cli/command.go:165 +0x4c2
main.runMain(0x0)
        /src/cmd/dolt/dolt.go:297 +0x1250
main.main()
        /src/cmd/dolt/dolt.go:132 +0x2e

Enviornment

  • Windows10
  • Dolt version 0.27.2
@VinaiRachakonda
Copy link
Contributor

@VinaiRachakonda VinaiRachakonda commented Aug 10, 2021

Great catch. We'll fix this.

@zachmu zachmu added the bug label Aug 12, 2021
@zachmu zachmu changed the title Dolt fails to delete remote branches. dolt branch -d can't delete remote branches Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants