Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

make dev.clone.ssh errors when using repository forks #1015

Open
rgraber opened this issue Feb 9, 2023 · 1 comment
Open

make dev.clone.ssh errors when using repository forks #1015

rgraber opened this issue Feb 9, 2023 · 1 comment

Comments

@rgraber
Copy link
Contributor

rgraber commented Feb 9, 2023

Running make dev.clone.ssh results in fatal: ref refs/remotes/origin/HEAD is not a symbolic ref if you are working on a fork for any one of the devstack services. This is particularly problematic for repositories like course-discovery, where most people don't have write access and thus have to work on forks for development.
This also hinders running update-dbs-init-sql-scripts.sh because that calls make dev.clone.ssh

@rgraber
Copy link
Contributor Author

rgraber commented Feb 10, 2023

The place for the fix seems to be in _checkout_and_update_branch. Changing CHECKOUT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed -E 's@^refs/remotes/(upstream|origin)/@@') to CHECKOUT_BRANCH=$((git symbolic-ref refs/remotes/origin/HEAD || git symbolic-ref refs/remotes/upstream/HEAD) | sed -E 's@^refs/remotes/(upstream|origin)/@@') resolves the immediate issue but causes problem if one of the forked repositories is on a branch besides master. I think to fix it completely we have to determine for everything whether we want to fetch from origin or upstream.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant