Skip to content

rugged misinterpreting branch name as a SHA #916

Description

@vchepkov

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions