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

git: vcs import by hash does not work for hashes not in local history #258

Open
timor-raiman opened this issue Apr 20, 2023 · 1 comment

Comments

@timor-raiman
Copy link

Run the following to reproduce:

git clone [email protected]:timor-raiman/action-ros-ci.git -b vcs-issue && cd action-ros-ci
git fetch origin +refs/pull/3/*:refs/remotes/origin/pr/3/*
export PRMERGE_SHA=`git rev-parse origin/pr/3/merge`
rm -rf new-path/ && mkdir -p new-path/
cat test-vcs-issue.repo | envsubst | vcs import --force --recursive new-path/

Explanation:
vcs does not fetch the git commits corresponding to pull requests (unless it has access to the source branch and we are interested in /head rather than /merge)

Solution:
Given the desired version is a commit hash, vcs should first run git fetch origin <the hash> before attempting to checkout the hash.

@timor-raiman
Copy link
Author

@christophebedard, @Nir-Az this needs fixing for ros-tooling/action-ros-ci#816

This is related to ros-tooling/action-ros-ci#812

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