Unverified Commit f26dd373 authored by Casey Hillers's avatar Casey Hillers Committed by GitHub

[packaging] Run git gc to minimize .git disk footprint (#113467)

parent bc70ae0f
...@@ -418,6 +418,9 @@ class ArchiveCreator { ...@@ -418,6 +418,9 @@ class ArchiveCreator {
// Make the origin point to github instead of the chromium mirror. // Make the origin point to github instead of the chromium mirror.
await _runGit(<String>['remote', 'set-url', 'origin', githubRepo]); await _runGit(<String>['remote', 'set-url', 'origin', githubRepo]);
// Minify `.git` footprint (saving about ~100 MB as of Oct 2022)
await _runGit(<String>['gc', '--prune=now', '--aggressive']);
} }
/// Retrieve the MinGit executable from storage and unpack it. /// Retrieve the MinGit executable from storage and unpack it.
......
...@@ -126,6 +126,7 @@ void main() { ...@@ -126,6 +126,7 @@ void main() {
'git clone -b beta https://flutter.googlesource.com/mirrors/flutter': null, 'git clone -b beta https://flutter.googlesource.com/mirrors/flutter': null,
'git reset --hard $testRef': null, 'git reset --hard $testRef': null,
'git remote set-url origin https://github.com/flutter/flutter.git': null, 'git remote set-url origin https://github.com/flutter/flutter.git': null,
'git gc --prune=now --aggressive': null,
'git describe --tags --exact-match $testRef': <ProcessResult>[ProcessResult(0, 0, 'v1.2.3', '')], 'git describe --tags --exact-match $testRef': <ProcessResult>[ProcessResult(0, 0, 'v1.2.3', '')],
'$flutter --version --machine': <ProcessResult>[ '$flutter --version --machine': <ProcessResult>[
ProcessResult(0, 0, '{"dartSdkVersion": "3.2.1"}', ''), ProcessResult(0, 0, '{"dartSdkVersion": "3.2.1"}', ''),
...@@ -162,6 +163,7 @@ void main() { ...@@ -162,6 +163,7 @@ void main() {
'git clone -b beta https://flutter.googlesource.com/mirrors/flutter': null, 'git clone -b beta https://flutter.googlesource.com/mirrors/flutter': null,
'git reset --hard $testRef': null, 'git reset --hard $testRef': null,
'git remote set-url origin https://github.com/flutter/flutter.git': null, 'git remote set-url origin https://github.com/flutter/flutter.git': null,
'git gc --prune=now --aggressive': null,
'git describe --tags --exact-match $testRef': <ProcessResult>[ProcessResult(0, 0, 'v1.2.3', '')], 'git describe --tags --exact-match $testRef': <ProcessResult>[ProcessResult(0, 0, 'v1.2.3', '')],
'$flutter --version --machine': <ProcessResult>[ '$flutter --version --machine': <ProcessResult>[
ProcessResult(0, 0, '{"dartSdkVersion": "3.2.1"}', ''), ProcessResult(0, 0, '{"dartSdkVersion": "3.2.1"}', ''),
...@@ -209,6 +211,7 @@ void main() { ...@@ -209,6 +211,7 @@ void main() {
'git clone -b beta https://flutter.googlesource.com/mirrors/flutter': null, 'git clone -b beta https://flutter.googlesource.com/mirrors/flutter': null,
'git reset --hard $testRef': null, 'git reset --hard $testRef': null,
'git remote set-url origin https://github.com/flutter/flutter.git': null, 'git remote set-url origin https://github.com/flutter/flutter.git': null,
'git gc --prune=now --aggressive': null,
'git describe --tags --exact-match $testRef': <ProcessResult>[ProcessResult(0, 0, 'v1.2.3', '')], 'git describe --tags --exact-match $testRef': <ProcessResult>[ProcessResult(0, 0, 'v1.2.3', '')],
'$flutter --version --machine': <ProcessResult>[ '$flutter --version --machine': <ProcessResult>[
ProcessResult(0, 0, '{"dartSdkVersion": "3.2.1"}', ''), ProcessResult(0, 0, '{"dartSdkVersion": "3.2.1"}', ''),
...@@ -266,6 +269,7 @@ void main() { ...@@ -266,6 +269,7 @@ void main() {
'git clone -b beta https://flutter.googlesource.com/mirrors/flutter': null, 'git clone -b beta https://flutter.googlesource.com/mirrors/flutter': null,
'git reset --hard $testRef': null, 'git reset --hard $testRef': null,
'git remote set-url origin https://github.com/flutter/flutter.git': null, 'git remote set-url origin https://github.com/flutter/flutter.git': null,
'git gc --prune=now --aggressive': null,
'git describe --tags --abbrev=0 $testRef': <ProcessResult>[ProcessResult(0, 0, 'v1.2.3', '')], 'git describe --tags --abbrev=0 $testRef': <ProcessResult>[ProcessResult(0, 0, 'v1.2.3', '')],
'$flutter --version --machine': <ProcessResult>[ '$flutter --version --machine': <ProcessResult>[
ProcessResult(0, 0, '{"dartSdkVersion": "3.2.1"}', ''), ProcessResult(0, 0, '{"dartSdkVersion": "3.2.1"}', ''),
...@@ -315,6 +319,7 @@ void main() { ...@@ -315,6 +319,7 @@ void main() {
'git clone -b beta https://flutter.googlesource.com/mirrors/flutter': null, 'git clone -b beta https://flutter.googlesource.com/mirrors/flutter': null,
'git reset --hard $testRef': null, 'git reset --hard $testRef': null,
'git remote set-url origin https://github.com/flutter/flutter.git': null, 'git remote set-url origin https://github.com/flutter/flutter.git': null,
'git gc --prune=now --aggressive': null,
'git describe --tags --exact-match $testRef': <ProcessResult>[ProcessResult(0, 0, 'v1.2.3', '')], 'git describe --tags --exact-match $testRef': <ProcessResult>[ProcessResult(0, 0, 'v1.2.3', '')],
'$flutter --version --machine': <ProcessResult>[ '$flutter --version --machine': <ProcessResult>[
ProcessResult(0, 0, '{"dartSdkVersion": "3.2.1"}', ''), ProcessResult(0, 0, '{"dartSdkVersion": "3.2.1"}', ''),
......
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