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

Fix detection of missing commits on checkout #2322

Merged
merged 1 commit into from Aug 28, 2023

Commits on Aug 26, 2023

  1. Fix detection of missing commits on checkout

    I upgraded from 3.31 to 3.52 and started seeing 'reference is not a
    tree' errors in CI. Something in the Buildkite code was not catching
    this properly and causing the agent to recreate the repo.
    
    In my case, this was being caused by force pushes to branches with open
    PRs happening soon after a previous push.
    
    ```
    $ git fetch -v --prune -- origin refs/pull/123/head
    ...
    From github.com:my/repo
     * branch                    refs/pull/123/head -> FETCH_HEAD
    $ git checkout -f 7890000000
    fatal: reference is not a tree: 7890000000
    ⚠️ Warning: Checkout failed! checking out commit "7890000000": exit status 128 (Attempt 1/3 Retrying in 2s)
    $ git clone -v -- git@github.com:my/repo.git .
    Cloning into '.'...
    ...
    $ git clean -fdqx -e /.local
    $ git fetch -v --prune -- origin refs/pull/123/head
    ```
    
    Based on buildkite#2286, I assume
    something similar is happening - the output of the process isn't being
    properly captured.
    goodspark committed Aug 26, 2023
    Configuration menu
    Copy the full SHA
    706407d View commit details
    Browse the repository at this point in the history