Unverified Commit cfcb9887 authored by Dan Field's avatar Dan Field Committed by GitHub

Do not use --first-parent when determining version on master (#69726)

parent 496efca1
...@@ -779,7 +779,7 @@ class GitTagVersion { ...@@ -779,7 +779,7 @@ class GitTagVersion {
// recent tag and number of commits past. // recent tag and number of commits past.
return parse( return parse(
_runGit( _runGit(
'git describe --match *.*.* --first-parent --long --tags', 'git describe --match *.*.* --long --tags',
processUtils, processUtils,
workingDirectory, workingDirectory,
) )
......
...@@ -341,7 +341,7 @@ void main() { ...@@ -341,7 +341,7 @@ void main() {
), ),
const FakeCommand( const FakeCommand(
command: <String>[ command: <String>[
'git', 'describe', '--match', '*.*.*', '--first-parent', '--long', '--tags', 'git', 'describe', '--match', '*.*.*', '--long', '--tags',
], ],
stdout: 'v1.12.16-19-gb45b676af', stdout: 'v1.12.16-19-gb45b676af',
), ),
......
...@@ -140,7 +140,7 @@ void main() { ...@@ -140,7 +140,7 @@ void main() {
workingDirectory: Cache.flutterRoot)).thenReturn(result); workingDirectory: Cache.flutterRoot)).thenReturn(result);
when(processManager.runSync('git tag --points-at HEAD'.split(' '), when(processManager.runSync('git tag --points-at HEAD'.split(' '),
workingDirectory: Cache.flutterRoot)).thenReturn(result); workingDirectory: Cache.flutterRoot)).thenReturn(result);
when(processManager.runSync('git describe --match *.*.* --first-parent --long --tags'.split(' '), when(processManager.runSync('git describe --match *.*.* --long --tags'.split(' '),
workingDirectory: Cache.flutterRoot)).thenReturn(result); workingDirectory: Cache.flutterRoot)).thenReturn(result);
when(processManager.runSync(FlutterVersion.gitLog('-n 1 --pretty=format:%ad --date=iso'.split(' ')), when(processManager.runSync(FlutterVersion.gitLog('-n 1 --pretty=format:%ad --date=iso'.split(' ')),
workingDirectory: Cache.flutterRoot)).thenReturn(result); workingDirectory: Cache.flutterRoot)).thenReturn(result);
......
...@@ -81,7 +81,7 @@ void main() { ...@@ -81,7 +81,7 @@ void main() {
)); ));
processManager.addCommand(const FakeCommand( processManager.addCommand(const FakeCommand(
command: <String>['git', 'describe', '--match', '*.*.*', '--first-parent', '--long', '--tags'], command: <String>['git', 'describe', '--match', '*.*.*', '--long', '--tags'],
stdout: '0.1.2-3-1234abcd', stdout: '0.1.2-3-1234abcd',
)); ));
...@@ -563,7 +563,7 @@ void main() { ...@@ -563,7 +563,7 @@ void main() {
stdout: '', // no tag stdout: '', // no tag
), ),
const FakeCommand( const FakeCommand(
command: <String>['git', 'describe', '--match', '*.*.*', '--first-parent', '--long', '--tags'], command: <String>['git', 'describe', '--match', '*.*.*', '--long', '--tags'],
stdout: '$devTag-$commitsAhead-g$headRevision', stdout: '$devTag-$commitsAhead-g$headRevision',
), ),
], ],
...@@ -585,7 +585,7 @@ void main() { ...@@ -585,7 +585,7 @@ void main() {
environment: anyNamed('environment'), environment: anyNamed('environment'),
)).thenReturn(RunResult(ProcessResult(105, 0, '', ''), <String>['git', 'fetch'])); )).thenReturn(RunResult(ProcessResult(105, 0, '', ''), <String>['git', 'fetch']));
when(processUtils.runSync( when(processUtils.runSync(
<String>['git', 'describe', '--match', '*.*.*', '--first-parent', '--long', '--tags'], <String>['git', 'describe', '--match', '*.*.*', '--long', '--tags'],
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'), environment: anyNamed('environment'),
)).thenReturn(RunResult(ProcessResult(106, 0, 'v0.1.2-3-1234abcd', ''), <String>['git', 'describe'])); )).thenReturn(RunResult(ProcessResult(106, 0, 'v0.1.2-3-1234abcd', ''), <String>['git', 'describe']));
...@@ -611,7 +611,7 @@ void main() { ...@@ -611,7 +611,7 @@ void main() {
environment: anyNamed('environment'), environment: anyNamed('environment'),
)); ));
verify(processUtils.runSync( verify(processUtils.runSync(
<String>['git', 'describe', '--match', '*.*.*', '--first-parent', '--long', '--tags'], <String>['git', 'describe', '--match', '*.*.*', '--long', '--tags'],
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'), environment: anyNamed('environment'),
)).called(1); )).called(1);
...@@ -630,7 +630,7 @@ void main() { ...@@ -630,7 +630,7 @@ void main() {
environment: anyNamed('environment'), environment: anyNamed('environment'),
)).thenReturn(RunResult(ProcessResult(106, 0, '', ''), <String>['git', 'fetch'])); )).thenReturn(RunResult(ProcessResult(106, 0, '', ''), <String>['git', 'fetch']));
when(processUtils.runSync( when(processUtils.runSync(
<String>['git', 'describe', '--match', '*.*.*', '--first-parent', '--long', '--tags'], <String>['git', 'describe', '--match', '*.*.*', '--long', '--tags'],
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'), environment: anyNamed('environment'),
)).thenReturn(RunResult(ProcessResult(107, 0, 'v0.1.2-3-1234abcd', ''), <String>['git', 'describe'])); )).thenReturn(RunResult(ProcessResult(107, 0, 'v0.1.2-3-1234abcd', ''), <String>['git', 'describe']));
...@@ -656,7 +656,7 @@ void main() { ...@@ -656,7 +656,7 @@ void main() {
environment: anyNamed('environment'), environment: anyNamed('environment'),
)); ));
verify(processUtils.runSync( verify(processUtils.runSync(
<String>['git', 'describe', '--match', '*.*.*', '--first-parent', '--long', '--tags'], <String>['git', 'describe', '--match', '*.*.*', '--long', '--tags'],
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'), environment: anyNamed('environment'),
)).called(1); )).called(1);
...@@ -683,7 +683,7 @@ void main() { ...@@ -683,7 +683,7 @@ void main() {
<String>['git', 'tag', '--points-at', 'HEAD'], <String>['git', 'tag', '--points-at', 'HEAD'],
)); ));
when(processUtils.runSync( when(processUtils.runSync(
<String>['git', 'describe', '--match', '*.*.*', '--first-parent', '--long', '--tags'], <String>['git', 'describe', '--match', '*.*.*', '--long', '--tags'],
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'), environment: anyNamed('environment'),
)).thenReturn(RunResult(ProcessResult(111, 0, 'v0.1.2-3-1234abcd', ''), <String>['git', 'describe'])); )).thenReturn(RunResult(ProcessResult(111, 0, 'v0.1.2-3-1234abcd', ''), <String>['git', 'describe']));
...@@ -701,7 +701,7 @@ void main() { ...@@ -701,7 +701,7 @@ void main() {
environment: anyNamed('environment'), environment: anyNamed('environment'),
)).called(1); )).called(1);
verify(processUtils.runSync( verify(processUtils.runSync(
<String>['git', 'describe', '--match', '*.*.*', '--first-parent', '--long', '--tags'], <String>['git', 'describe', '--match', '*.*.*', '--long', '--tags'],
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'), environment: anyNamed('environment'),
)).called(1); )).called(1);
...@@ -728,7 +728,7 @@ void main() { ...@@ -728,7 +728,7 @@ void main() {
<String>['git', 'tag', '--points-at', 'HEAD'], <String>['git', 'tag', '--points-at', 'HEAD'],
)); ));
when(processUtils.runSync( when(processUtils.runSync(
<String>['git', 'describe', '--match', '*.*.*', '--first-parent', '--long', '--tags'], <String>['git', 'describe', '--match', '*.*.*', '--long', '--tags'],
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'), environment: anyNamed('environment'),
)).thenReturn(RunResult(ProcessResult(111, 0, 'v0.1.2-3-1234abcd', ''), <String>['git', 'describe'])); )).thenReturn(RunResult(ProcessResult(111, 0, 'v0.1.2-3-1234abcd', ''), <String>['git', 'describe']));
...@@ -866,7 +866,7 @@ void fakeData( ...@@ -866,7 +866,7 @@ void fakeData(
environment: anyNamed('environment'), environment: anyNamed('environment'),
)).thenReturn(ProcessResult(106, 0, '', '')); )).thenReturn(ProcessResult(106, 0, '', ''));
when(pm.runSync( when(pm.runSync(
<String>['git', 'describe', '--match', '*.*.*', '--first-parent', '--long', '--tags'], <String>['git', 'describe', '--match', '*.*.*', '--long', '--tags'],
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'), environment: anyNamed('environment'),
)).thenReturn(ProcessResult(107, 0, 'v0.1.2-3-1234abcd', '')); )).thenReturn(ProcessResult(107, 0, 'v0.1.2-3-1234abcd', ''));
......
...@@ -99,7 +99,6 @@ void main() { ...@@ -99,7 +99,6 @@ void main() {
'describe', 'describe',
'--match', '--match',
'v*.*.*', 'v*.*.*',
'--first-parent',
'--long', '--long',
'--tags', '--tags',
], workingDirectory: testDirectory.path); ], workingDirectory: testDirectory.path);
...@@ -123,7 +122,6 @@ void main() { ...@@ -123,7 +122,6 @@ void main() {
'describe', 'describe',
'--match', '--match',
'v*.*.*', 'v*.*.*',
'--first-parent',
'--long', '--long',
'--tags', '--tags',
], workingDirectory: testDirectory.path); ], workingDirectory: testDirectory.path);
......
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