Skip to content

Flutter upgrade should refuse to run or run properly on a branch that comes from a fork. #14120

@gspencergoog

Description

@gspencergoog

I recently tried to run flutter upgrade because I was prompted to:

Building flutter tool...
  ╔════════════════════════════════════════════════════════════════════════════╗
  ║ WARNING: your installation of Flutter is 45 days old.                      ║
  ║                                                                            ║
  ║ To update to the latest version, run "flutter upgrade".                    ║
  ╚════════════════════════════════════════════════════════════════════════════╝

Running "flutter packages get" in catalog...
(code/flutter:traversal) -- flutter > flutter upgrade
Unable to upgrade Flutter: no upstream repository configured.
(code/flutter:traversal) -- flutter > git remote -v
origin	[email protected]:gspencergoog/flutter.git (fetch)
origin	[email protected]:gspencergoog/flutter.git (push)
upstream	[email protected]:flutter/flutter.git (fetch)
upstream	[email protected]:flutter/flutter.git (push)

And because my branch wasn't branched from flutter/flutter.git, but rather from gspencergoog/flutter.git, flutter upgrade errored out without telling me anything about what I should do, how I could fix it, or why it failed. This seems like a case specific to people who work on the flutter project, but really anyone who forks flutter for any reason will encounter it eventually.

We should:

  1. Not warn about stale installs for forked repos
  2. Fail to run flutter upgrade in a forked repo branch, or, alternatively
  3. Make flutter upgrade do something useful in a forked repo branch and not error out.
  4. At the very least, change the error message so that it is truthful (I did have an upstream repo configured, it just didn't match with the origin).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecttoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions