You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2021/10/07 15:02:37 UTC

[GitHub] [mynewt-newt] utzig commented on a change in pull request #445: repo: Upgrade: use branch or commit

utzig commented on a change in pull request #445:
URL: https://github.com/apache/mynewt-newt/pull/445#discussion_r724269456



##########
File path: newt/repo/repo.go
##########
@@ -318,13 +318,19 @@ func (r *Repo) DirtyState() (string, error) {
 }
 
 func (r *Repo) Upgrade(ver newtutil.RepoVersion) error {
-	commit, err := r.CommitFromVer(ver)
-	if err != nil {
-		return err
-	}
+	if branch := r.downloader.MainBranch(); branch != "" {

Review comment:
       I believe you could just add `if branch := r.downloader.MainBranch(); branch == "" {` around the `r.CommitFromVer` call block, and avoid the `r.updateRepo` copypasta.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org