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

rugged misinterpreting branch name as a SHA #916

Open
vchepkov opened this issue May 9, 2022 · 1 comment
Open

rugged misinterpreting branch name as a SHA #916

vchepkov opened this issue May 9, 2022 · 1 comment

Comments

@vchepkov
Copy link

vchepkov commented May 9, 2022

Here is a reproducer, courtesy of @jarretlavallee

irb(main):001:0> require 'rugged'
=> true
irb(main):002:0> repo = Rugged::Repository.init_at('/tmp/test', :bare)
=> #<Rugged::Repository:22047760 {path: "/tmp/test/"}>
irb(main):003:0> repo.rev_parse('ITTO-4954-gdc')
Traceback (most recent call last):
        4: from /opt/puppetlabs/puppet/bin/irb:11:in `<main>'
        3: from (irb):3
        2: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/rugged-0.27.7/lib/rugged/repository.rb:154:in `rev_parse'
        1: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/rugged-0.27.7/lib/rugged/repository.rb:154:in `rev_parse'
Rugged::ObjectError (ambiguous lookup - OID prefix is too short)

somehow magic suffix -gdc makes rugged to err

@carlosmn
Copy link
Member

That'll be the -g yeah which looks like it's making libgit2 think it's parsing a git describe string. Presumably it should fall back out of that or maybe look first for refs, I don't remember what git itself does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants