git-init: do not assume master
as default branch
#2822
Labels
good first issue
Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.
help wanted
Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
kind/bug
Categorizes issue or PR as related to a bug.
As of today, when the user doesn't specific a revision (branch, commit, …), we are defaulting to
master
. There is some problems with that:master
might not be present on the remote. The recent wave of change of default branches on several project, including https:/spring-projects/spring-petclinic are putting this problem into light : see tektoncd/catalog#365.Instead of making the assumption that we should use
master
when the revision is empty, we should inspect the remote.git
can give us this information.After doing the
git init
and adding the remotegit remote add origin …
, we should get the default branch (remote HEAD) if the revision isn't specified. The way to do it should be as simple asgit symbolic-ref refs/remotes/origin/HEAD
👼/kind bug
The text was updated successfully, but these errors were encountered: