Unverified Commit 3e31dbd2 authored by Christopher Fujino's avatar Christopher Fujino Committed by GitHub

fix ref (#56721)

parent 9bec7e90
...@@ -96,7 +96,7 @@ bool run({ ...@@ -96,7 +96,7 @@ bool run({
git.run('fetch $origin', 'fetch $origin'); git.run('fetch $origin', 'fetch $origin');
git.run('reset $commit --hard', 'reset to the release commit'); git.run('reset $commit --hard', 'reset to the release commit');
String version = getFullTag(git); String version = getFullTag(git, origin);
version = incrementLevel(version, level); version = incrementLevel(version, level);
...@@ -177,10 +177,10 @@ ArgResults parseArguments(ArgParser argParser, List<String> args) { ...@@ -177,10 +177,10 @@ ArgResults parseArguments(ArgParser argParser, List<String> args) {
} }
/// Obtain the version tag of the previous dev release. /// Obtain the version tag of the previous dev release.
String getFullTag(Git git) { String getFullTag(Git git, String remote) {
const String glob = '*.*.*-*.*.pre'; const String glob = '*.*.*-*.*.pre';
// describe the latest dev release // describe the latest dev release
const String ref = 'refs/heads/dev'; final String ref = 'refs/remotes/$remote/dev';
return git.getOutput( return git.getOutput(
'describe --match $glob --exact-match --tags $ref', 'describe --match $glob --exact-match --tags $ref',
'obtain last released version number', 'obtain last released version number',
......
...@@ -136,7 +136,7 @@ void main() { ...@@ -136,7 +136,7 @@ void main() {
when(mockGit.getOutput('remote get-url $origin', any)).thenReturn(kUpstreamRemote); when(mockGit.getOutput('remote get-url $origin', any)).thenReturn(kUpstreamRemote);
when(mockGit.getOutput('status --porcelain', any)).thenReturn(''); when(mockGit.getOutput('status --porcelain', any)).thenReturn('');
when(mockGit.getOutput( when(mockGit.getOutput(
'describe --match *.*.*-*.*.pre --exact-match --tags refs/heads/dev', 'describe --match *.*.*-*.*.pre --exact-match --tags refs/remotes/$origin/dev',
any, any,
)).thenReturn('1.2.3-0.0.pre'); )).thenReturn('1.2.3-0.0.pre');
fakeArgResults = FakeArgResults( fakeArgResults = FakeArgResults(
...@@ -161,7 +161,7 @@ void main() { ...@@ -161,7 +161,7 @@ void main() {
when(mockGit.getOutput('remote get-url $origin', any)).thenReturn(kUpstreamRemote); when(mockGit.getOutput('remote get-url $origin', any)).thenReturn(kUpstreamRemote);
when(mockGit.getOutput('status --porcelain', any)).thenReturn(''); when(mockGit.getOutput('status --porcelain', any)).thenReturn('');
when(mockGit.getOutput( when(mockGit.getOutput(
'describe --match *.*.*-*.*.pre --exact-match --tags refs/heads/dev', 'describe --match *.*.*-*.*.pre --exact-match --tags refs/remotes/$origin/dev',
any, any,
)).thenReturn('1.2.3-0.0.pre'); )).thenReturn('1.2.3-0.0.pre');
when(mockGit.getOutput('rev-parse HEAD', any)).thenReturn(commit); when(mockGit.getOutput('rev-parse HEAD', any)).thenReturn(commit);
...@@ -188,7 +188,7 @@ void main() { ...@@ -188,7 +188,7 @@ void main() {
when(mockGit.getOutput('remote get-url $origin', any)).thenReturn(kUpstreamRemote); when(mockGit.getOutput('remote get-url $origin', any)).thenReturn(kUpstreamRemote);
when(mockGit.getOutput('status --porcelain', any)).thenReturn(''); when(mockGit.getOutput('status --porcelain', any)).thenReturn('');
when(mockGit.getOutput( when(mockGit.getOutput(
'describe --match *.*.*-*.*.pre --exact-match --tags refs/heads/dev', 'describe --match *.*.*-*.*.pre --exact-match --tags refs/remotes/$origin/dev',
any, any,
)).thenReturn('1.2.3-0.0.pre'); )).thenReturn('1.2.3-0.0.pre');
when(mockGit.getOutput('rev-parse HEAD', any)).thenReturn(commit); when(mockGit.getOutput('rev-parse HEAD', any)).thenReturn(commit);
......
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