We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d5bd104 commit f89a46bCopy full SHA for f89a46b
newt/repo/repo.go
@@ -318,13 +318,19 @@ func (r *Repo) DirtyState() (string, error) {
318
}
319
320
func (r *Repo) Upgrade(ver newtutil.RepoVersion) error {
321
- commit, err := r.CommitFromVer(ver)
322
- if err != nil {
323
- return err
324
- }
+ if branch := r.downloader.MainBranch(); branch != "" {
+ if err := r.updateRepo(branch); err != nil {
+ return err
+ }
325
+ } else {
326
+ commit, err := r.CommitFromVer(ver)
327
+ if err != nil {
328
329
330
- if err := r.updateRepo(commit); err != nil {
331
+ if err := r.updateRepo(commit); err != nil {
332
333
334
335
336
return nil
0 commit comments