Commit 4e976278 authored by Adam Barth's avatar Adam Barth

Merge pull request #1116 from abarth/upgrade_with_no_upstream

Handle trying to upgrade Flutter with no upstream
parents dfcc0c71 23031886
......@@ -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