Commit 23031886 authored by Adam Barth's avatar Adam Barth

Handle trying to upgrade Flutter with no upstream

Fixes #1084
parent e3668470
......@@ -14,7 +14,16 @@ class UpgradeCommand extends FlutterCommand {
@override
Future<int> runInProject() async {
int code = await runCommandAndStreamOutput([
try {
runCheckedSync(<String>[
'git', 'rev-parse', '@{u}'
], workingDirectory: ArtifactStore.flutterRoot);
} catch (e) {
print('Unable to upgrade Flutter. No upstream repository configured for Flutter.');
return 1;
}
int code = await runCommandAndStreamOutput(<String>[
'git', 'pull', '--ff-only'
], workingDirectory: ArtifactStore.flutterRoot);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment