Skip to content

Commit 7923009

Browse files
committed
repo: Upgrade: use branch or commit
While doing newt upgrade the script tries to checkout to 'master' while there is 'main' instead. Now it is possible to use the 'branch: 'main'' in repository.yml file, and it doesn't only allow to fetch properly, but also to checkout. example from repository.yml: repository.xyz: type: git vers: 0.0.0 branch: 'main' url: 'git@github.com:xyz.git'
1 parent 2c82e98 commit 7923009

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

newt/repo/repo.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,10 @@ func (r *Repo) Upgrade(ver newtutil.RepoVersion) error {
323323
return err
324324
}
325325

326+
if branch := r.downloader.MainBranch(); branch != "" {
327+
commit = branch
328+
}
329+
326330
if err := r.updateRepo(commit); err != nil {
327331
return err
328332
}

0 commit comments

Comments
 (0)