Closed forslund closed 4 years ago
Hey I was just reading some of the git docs to consider possible edge cases and saw:
With -a or --auto, the remote is queried to determine its HEAD, then the symbolic-ref refs/remotes/
/HEAD is set to the same branch. e.g., if the remote HEAD is pointed at next, "git remote set-head origin -a" will set the symbolic-ref refs/remotes/origin/HEAD to refs/remotes/origin/next. This will only work if refs/remotes/origin/next already exists; if not it must be fetched first.
Whilst unlikely, I guess there's the chance that the remote HEAD doesn't exist locally yet. Is it worth running fetch
first?
Maybe, at this point the submodule should be initialized and thus fetched...I think...It can't do any harm however so we might just do it so it's 100 % safe...
This seems to be working well as it is. Do you want to add in the extra fetch to be super safe?
Maybe we can merge it as it is and if the issue occurs we can handle it.
This runs "git remote origin -a" to set the local HEAD reference to the same as the remote. (see "git remote set-head --help")
Could use some additional testing but seems safe as far as I can see.