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

refactor: remove useless git checkout after a git clone #1966

Merged
merged 4 commits into from
Mar 1, 2024

Conversation

olblak
Copy link
Member

@olblak olblak commented Feb 29, 2024

While working on #1964

I released that we always run git checkout the default branch(main) after a git clone operation.
even though a git checkout is done before each source/condition/targets

This initial git checkout seems useless and generate error in some situation

We can easily reproduce the problem with the following manifests

updatecli.yaml
scms:
  default:
    kind: git 
    spec:
      url: https://github.com/crate-ci/typos.git

triggers

Console Output
+++++++++++
+ PREPARE +
+++++++++++

Loading Pipeline "test.2.yaml"

SCM repository retrieved: 1
ERROR: initial git checkout failed for repository https://github.com/crate-ci/typos.git - reference not found
ERROR: err - reference not found

As updatecli tries to run a git checkout of the default branch "main" which doesn't exist on that repository

Test

To test this pull request, you can run the following commands:

cd <to_package_directory>
go test

Additional Information

Tradeoff

Potential improvement

Signed-off-by: Olblak <me@olblak.com>
@olblak olblak added the cleanup label Feb 29, 2024
@olblak olblak merged commit c4b617c into updatecli:main Mar 1, 2024
6 checks passed
@olblak olblak deleted the clean/git/clone branch April 3, 2024 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant