zsh-snap icon indicating copy to clipboard operation
zsh-snap copied to clipboard

Unable to update git repos where default branch name has '/'

Open ealap opened this issue 2 months ago • 0 comments

Describe the bug

znap pull fails when a plugin repo has a default branch that has '/' in its name.

Steps To Reproduce

1. znap source 'ealap/zsh-abbr' # default branch is 'dev/ealap/main'
2. znap pull

Expected behavior

znap pull can successfully update the plugin

Observed behavior

An error occurs.

ealap/zsh-abbr couldn't find remote ref dev
no upstream

It seems to be only using the string before the first '/'

Environment:

  • OS: macOS, debian
  • Terminal: alacritty
  • Zsh version: 5.9
  • Repo version: main f8685ea

Additional context

A quick scan of the code tells me the problem likely comes from here but I don't understand it fully yet. https://github.com/marlonrichert/zsh-snap/blame/f8685ea5933335ea4cbd54780ace16ef85c346bd/functions/..znap.fetch#L12

Workaround for me now is to just use a simple branch name as default for my forked repos.

ealap avatar Apr 17 '24 11:04 ealap