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

CircleCI shallow clone issue #103

Closed
dankohn opened this issue Oct 25, 2015 · 0 comments
Closed

CircleCI shallow clone issue #103

dankohn opened this issue Oct 25, 2015 · 0 comments

Comments

@dankohn
Copy link
Contributor

dankohn commented Oct 25, 2015

If you're getting an Object not found - no matching loose object error like the following on CircleCI or similar continuous integration servers, it may be caused by them running a shallow clone:

bundle exec pronto run -f github -c=$(git log --pretty=format:%H | tail -1) --exit-code
/home/ubuntu/cii-best-practices-badge/vendor/bundle/ruby/2.2.0/gems/pronto-0.4.3/lib/pronto/git/repository.rb:68:in `merge_base': Object not found - no matching loose object (9035627bcab7e9bd64dd47c37b7fbfd67045a106) (Rugged::OdbError)
    from /home/ubuntu/cii-best-practices-badge/vendor/bundle/ruby/2.2.0/gems/pronto-0.4.3/lib/pronto/git/repository.rb:68:in `merge_base'
    from /home/ubuntu/cii-best-practices-badge/vendor/bundle/ruby/2.2.0/gems/pronto-0.4.3/lib/pronto/git/repository.rb:15:in `diff'
    from /home/ubuntu/cii-best-practices-badge/vendor/bundle/ruby/2.2.0/gems/pronto-0.4.3/lib/pronto.rb:33:in `run'
    from /home/ubuntu/cii-best-practices-badge/vendor/bundle/ruby/2.2.0/gems/pronto-0.4.3/lib/pronto/cli.rb:52:in `run'
    from /home/ubuntu/cii-best-practices-badge/vendor/bundle/ruby/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /home/ubuntu/cii-best-practices-badge/vendor/bundle/ruby/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /home/ubuntu/cii-best-practices-badge/vendor/bundle/ruby/2.2.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /home/ubuntu/cii-best-practices-badge/vendor/bundle/ruby/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /home/ubuntu/cii-best-practices-badge/vendor/bundle/ruby/2.2.0/gems/pronto-0.4.3/bin/pronto:6:in `<top (required)>'
    from /home/ubuntu/cii-best-practices-badge/vendor/bundle/ruby/2.2.0/bin/pronto:23:in `load'

from /home/ubuntu/cii-best-practices-badge/vendor/bundle/ruby/2.2.0/bin/pronto:23:in `<main>' bundle exec pronto run -f github -c=$(git log --pretty=format:%H | tail -1) --exit-code returned exit code 1

The solution is do an unshallow git fetch before running pronto. For example, use the following syntax for circle.yml:

test:
  pre:
    - "[[ ! -s \"$(git rev-parse --git-dir)/shallow\" ]] || git fetch --unshallow"
  post:
    - bundle exec pronto run -f github -c=$(git log --pretty=format:%H | tail -1) --exit-code
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

1 participant