Skip to content

Flutter commands no longer work if a branch is cloned with --single-branch #162251

@DanTup

Description

@DanTup

Steps to reproduce

I have a GitHub action for cloning Flutter to run tests. The test run on various different branches but to save time/space only the branch being tested is cloned (the other branches run in different jobs) using --single-branch.

This used to work fine, but recently has stopped working because Flutter assumes it can access origin/master.

To repro:

  1. Run git clone --single-branch --branch beta https://github.com/flutter/flutter to clone the beta branch without all others
  2. Run ./flutter_beta/bin/flutter doctor

Expected results

flutter doctor should run successfully.

Actual results

PS D:\Temp> ./flutter_beta/bin/flutter doctor
fatal: Not a valid object name origin/master
Error: Unable to determine engine version...

Code sample

N/A

Screenshots or Video

Screenshots / Video demonstration

Image

Logs

Logs

Unable to get any verbose logs:

PS D:\Temp> ./flutter_beta/bin/flutter doctor -v
fatal: Not a valid object name origin/master
Error: Unable to determine engine version...

Flutter Doctor output

Doctor output

Unable to run:

PS D:\Temp> ./flutter_beta/bin/flutter doctor -v
fatal: Not a valid object name origin/master
Error: Unable to determine engine version...

Metadata

Metadata

Assignees

No one assigned

    Labels

    team-infraOwned by Infrastructure team

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions