Closed Jakski closed 3 years ago
This breaks some other stuff - including setting the default branch back to master instead of whatever the repository owner marks as default. The simple thing here is to simply add a checkout step I believe, which I was trying to avoid. I guess we can remove the -b option as well as --single-branch
init.defaultBranch=master
only prevents warning about missing default branch. It doesn't affect git fetch
. If repository owner marks different branch as a default, it will be reflected in remote HEAD
ref and used by JPM, unless user overwrites tag in project.janet
.
@bakpakin Does it address problem, that you described?
EDIT: Without init.defaultBranch=master
Git would print
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
making output less readable.
Ah, nice. Indeed, I tested with a repo that is now using main
as the default branch and works as expected. Great, lgtm then.
(git "clone" url bundle-dir "--single-branch" "-b" tag)
would break on loading lockfile, since lockfiles contain hashes instead of branch names, e.g.fatal: Remote branch <hash> not found in upstream origin
-C
with Git,--work-tree
and--git-dir
are redundant, unless non-standard repository layout is desired. https://git-scm.com/docs/git#Documentation/git.txt--CltpathgtServer does not allow request for unadvertised object <hash>
on attempt to fetch object without ref.