[flutter_conductor] Push correct revision to mirror remote from conductor (#88607)

This commit is contained in:
Christopher Fujino
2021-08-20 16:52:01 -07:00
committed by GitHub
parent 8fe859fb97
commit 4288937acc
2 changed files with 5 additions and 32 deletions

View File

@@ -84,10 +84,6 @@ void main() {
const FakeCommand(
command: <String>['git', 'checkout', workingBranch],
),
const FakeCommand(
command: <String>['git', 'rev-parse', 'HEAD'],
stdout: revision1,
),
]);
final FakePlatform platform = FakePlatform(
environment: <String, String>{
@@ -149,10 +145,6 @@ void main() {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(command: <String>['git', 'fetch', 'upstream']),
const FakeCommand(command: <String>['git', 'checkout', workingBranch]),
const FakeCommand(
command: <String>['git', 'rev-parse', 'HEAD'],
stdout: revision1,
),
const FakeCommand(
command: <String>['git', 'status', '--porcelain'],
stdout: 'MM blah',
@@ -233,10 +225,6 @@ void main() {
_initializeCiYamlFile(file);
},
),
const FakeCommand(
command: <String>['git', 'rev-parse', 'HEAD'],
stdout: revision1,
),
const FakeCommand(
command: <String>['git', 'status', '--porcelain'],
stdout: 'MM .ci.yaml',
@@ -247,7 +235,7 @@ void main() {
command: <String>['git', 'rev-parse', 'HEAD'],
stdout: revision2,
),
const FakeCommand(command: <String>['git', 'push', 'mirror', '$revision1:refs/heads/$workingBranch']),
const FakeCommand(command: <String>['git', 'push', 'mirror', 'HEAD:refs/heads/$workingBranch']),
]);
final FakePlatform platform = FakePlatform(
environment: <String, String>{
@@ -533,10 +521,6 @@ void main() {
_initializeCiYamlFile(file);
},
),
const FakeCommand(
command: <String>['git', 'rev-parse', 'HEAD'],
stdout: revision2,
),
const FakeCommand(
command: <String>['git', 'status', '--porcelain'],
stdout: 'MM /path/to/.ci.yaml',
@@ -627,10 +611,6 @@ void main() {
),
const FakeCommand(command: <String>['git', 'fetch', 'upstream']),
const FakeCommand(command: <String>['git', 'checkout', workingBranch]),
const FakeCommand(
command: <String>['git', 'rev-parse', 'HEAD'],
stdout: revision2,
),
const FakeCommand(
command: <String>['git', 'status', '--porcelain'],
stdout: 'MM path/to/.ci.yaml',
@@ -709,10 +689,6 @@ void main() {
_initializeCiYamlFile(file);
},
),
const FakeCommand(
command: <String>['git', 'rev-parse', 'HEAD'],
stdout: revision2,
),
const FakeCommand(
command: <String>['git', 'status', '--porcelain'],
stdout: 'MM path/to/.ci.yaml',
@@ -742,7 +718,7 @@ void main() {
stdout: revision4,
),
const FakeCommand(
command: <String>['git', 'push', 'mirror', '$revision2:refs/heads/$workingBranch'],
command: <String>['git', 'push', 'mirror', 'HEAD:refs/heads/$workingBranch'],
),
]);
writeStateToFile(
@@ -783,7 +759,7 @@ void main() {
);
expect(
stdio.stdout,
contains('Executed command: `git push mirror $revision2:refs/heads/$workingBranch`'),
contains('Executed command: `git push mirror HEAD:refs/heads/$workingBranch`'),
);
expect(stdio.error, isEmpty);
});