gpm icon indicating copy to clipboard operation
gpm copied to clipboard

Specify main or master branch

Open Johjo opened this issue 4 years ago • 1 comments

Hello,

i'm trying again the update command and i get this error :

gpm update
 INFO  gpm::gpm::command::update > running the "update" command
Updating all repositories
 INFO  gpm::gpm::command::update > updating repository https://gitlab.com/Johjo/ytreza-dev-package.git
⠁ [00:00:00] [------------------------------] 0/1 updating https://gitlab.com/Johjo/ytreza-dev-package.git
 TRACE gpm::gpm::git             > setup git credentials callback
 DEBUG gpm::gpm::git             > start cloning repository https://gitlab.com/Johjo/ytreza-dev-package.git in C:\Users\Jonathan\.gpm\cache\2c109486d14db5425962eac13191eb2d44f8f31b96f6572aa6947d0927c61847
 ERROR gpm::gpm::git             > Error { code: -3, klass: 4, message: "reference \'refs/remotes/origin/master\' not found" }
[src\gpm\git.rs:131] &e = Error {
    code: -3,
    klass: 4,
    message: "reference \'refs/remotes/origin/master\' not found",
}
  [00:00:00] [##############################] 1/1 updated repositories
 INFO  gpm::gpm::command::update > updated 0/1 repository
 ERROR gpm::gpm::command::update > package repositories have not been updated, check the logs for warnings/errors

The problem come from the branch name 'master'. Now, the default branch name on gitlab is 'main'. I create a branch master and everything was OK.

Could you send a specific error message or allow to specify the branch name ?

Thanks again for your job and sorry for my english ;)

Jonathan

Johjo avatar Sep 26 '21 05:09 Johjo

@Johjo thank you for your feedback!

This can probably be implemented using Remote::default_branch():

https://docs.rs/git2/0.13.23/git2/struct.Remote.html#method.default_branch

JMLX42 avatar Oct 18 '21 22:10 JMLX42