Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
e7d70fbf
Unverified
Commit
e7d70fbf
authored
Mar 06, 2020
by
Jonah Williams
Committed by
GitHub
Mar 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Fix version command for certain git workflows (#52062)" (#52128)
This reverts commit
20bf43b9
.
parent
a14ac4e3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
50 deletions
+3
-50
version.dart
packages/flutter_tools/lib/src/version.dart
+1
-5
upgrade_test.dart
...ter_tools/test/commands.shard/permeable/upgrade_test.dart
+0
-6
flutter_command_runner_test.dart
...est/general.shard/runner/flutter_command_runner_test.dart
+0
-2
version_test.dart
packages/flutter_tools/test/general.shard/version_test.dart
+2
-37
No files found.
packages/flutter_tools/lib/src/version.dart
View file @
e7d70fbf
...
...
@@ -23,9 +23,6 @@ enum Channel {
stable
,
}
/// The flutter GitHub repository.
const
String
_flutterGit
=
'https://github.com/flutter/flutter.git'
;
/// Retrieve a human-readable name for a given [channel].
///
/// Requires [FlutterVersion.officialChannels] to be correctly ordered.
...
...
@@ -236,7 +233,7 @@ class FlutterVersion {
'remote'
,
'add'
,
_versionCheckRemote
,
_flutterGit
,
'https://github.com/flutter/flutter.git'
,
]);
await
_run
(<
String
>[
'git'
,
'fetch'
,
_versionCheckRemote
,
branch
]);
return
_latestGitCommitDate
(
...
...
@@ -705,7 +702,6 @@ class GitTagVersion {
final
String
hash
;
static
GitTagVersion
determine
(
ProcessUtils
processUtils
,
[
String
workingDirectory
])
{
_runGit
(
'git fetch
$_flutterGit
--tags'
,
processUtils
,
workingDirectory
);
return
parse
(
_runGit
(
'git describe --match v*.*.* --first-parent --long --tags'
,
processUtils
,
workingDirectory
));
}
...
...
packages/flutter_tools/test/commands.shard/permeable/upgrade_test.dart
View file @
e7d70fbf
...
...
@@ -229,12 +229,6 @@ void main() {
setUp
(()
{
Cache
.
disableLocking
();
fakeProcessManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'git'
,
'fetch'
,
'https://github.com/flutter/flutter.git'
,
'--tags'
,
],
stdout:
'From https://github.com/flutter/flutter
\n
* branch HEAD -> FETCH_HEAD'
,
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'describe'
,
'--match'
,
'v*.*.*'
,
'--first-parent'
,
'--long'
,
'--tags'
,
...
...
packages/flutter_tools/test/general.shard/runner/flutter_command_runner_test.dart
View file @
e7d70fbf
...
...
@@ -165,8 +165,6 @@ void main() {
workingDirectory:
Cache
.
flutterRoot
)).
thenReturn
(
result
);
when
(
processManager
.
runSync
(
FlutterVersion
.
gitLog
(
'-n 1 --pretty=format:%ar'
.
split
(
' '
)),
workingDirectory:
Cache
.
flutterRoot
)).
thenReturn
(
result
);
when
(
processManager
.
runSync
(
'git fetch https://github.com/flutter/flutter.git --tags'
.
split
(
' '
),
workingDirectory:
Cache
.
flutterRoot
)).
thenReturn
(
result
);
when
(
processManager
.
runSync
(
'git describe --match v*.*.* --first-parent --long --tags'
.
split
(
' '
),
workingDirectory:
Cache
.
flutterRoot
)).
thenReturn
(
result
);
when
(
processManager
.
runSync
(
FlutterVersion
.
gitLog
(
'-n 1 --pretty=format:%ad --date=iso'
.
split
(
' '
)),
...
...
packages/flutter_tools/test/general.shard/version_test.dart
View file @
e7d70fbf
...
...
@@ -7,7 +7,6 @@ import 'dart:convert';
import
'package:collection/collection.dart'
show
ListEquality
;
import
'package:flutter_tools/src/base/context.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/process.dart'
;
import
'package:flutter_tools/src/base/time.dart'
;
import
'package:flutter_tools/src/base/utils.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
...
...
@@ -412,33 +411,6 @@ void main() {
'Could not interpret results of "git describe": v1.2.3-4-gxabcdef
\n
'
,
);
});
testUsingContext
(
'determine calls fetch --tags'
,
()
{
final
MockProcessUtils
processUtils
=
MockProcessUtils
();
when
(
processUtils
.
runSync
(
<
String
>[
'git'
,
'fetch'
,
'https://github.com/flutter/flutter.git'
,
'--tags'
],
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
anyNamed
(
'environment'
),
)).
thenReturn
(
RunResult
(
ProcessResult
(
105
,
0
,
''
,
''
),
<
String
>[
'git'
,
'fetch'
]));
when
(
processUtils
.
runSync
(
<
String
>[
'git'
,
'describe'
,
'--match'
,
'v*.*.*'
,
'--first-parent'
,
'--long'
,
'--tags'
],
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
anyNamed
(
'environment'
),
)).
thenReturn
(
RunResult
(
ProcessResult
(
106
,
0
,
'v0.1.2-3-1234abcd'
,
''
),
<
String
>[
'git'
,
'describe'
]));
GitTagVersion
.
determine
(
processUtils
,
'.'
);
verify
(
processUtils
.
runSync
(
<
String
>[
'git'
,
'fetch'
,
'https://github.com/flutter/flutter.git'
,
'--tags'
],
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
anyNamed
(
'environment'
),
)).
called
(
1
);
verify
(
processUtils
.
runSync
(
<
String
>[
'git'
,
'describe'
,
'--match'
,
'v*.*.*'
,
'--first-parent'
,
'--long'
,
'--tags'
],
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
anyNamed
(
'environment'
),
)).
called
(
1
);
});
}
void
_expectVersionMessage
(
String
message
)
{
...
...
@@ -517,8 +489,6 @@ void fakeData(
// Careful here! argsAre accepts 9 arguments and FlutterVersion.gitLog adds 4.
}
else
if
(
remoteCommitDate
!=
null
&&
listArgsAre
(
FlutterVersion
.
gitLog
(<
String
>[
'__flutter_version_check__/
$channel
'
,
'-n'
,
'1'
,
'--pretty=format:%ad'
,
'--date=iso'
])))
{
return
success
(
remoteCommitDate
.
toString
());
}
else
if
(
argsAre
(
'git'
,
'fetch'
,
'https://github.com/flutter/flutter.git'
,
'--tags'
))
{
return
success
(
''
);
}
throw
StateError
(
'Unexpected call to ProcessManager.run(
${invocation.positionalArguments}
,
${invocation.namedArguments}
)'
);
...
...
@@ -549,18 +519,13 @@ void fakeData(
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
anyNamed
(
'environment'
),
)).
thenReturn
(
ProcessResult
(
104
,
0
,
'1 second ago'
,
''
));
when
(
pm
.
runSync
(
<
String
>[
'git'
,
'fetch'
,
'https://github.com/flutter/flutter'
,
'--tags'
],
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
anyNamed
(
'environment'
),
)).
thenReturn
(
ProcessResult
(
105
,
0
,
''
,
''
));
when
(
pm
.
runSync
(
<
String
>[
'git'
,
'describe'
,
'--match'
,
'v*.*.*'
,
'--first-parent'
,
'--long'
,
'--tags'
],
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
anyNamed
(
'environment'
),
)).
thenReturn
(
ProcessResult
(
10
6
,
0
,
'v0.1.2-3-1234abcd'
,
''
));
)).
thenReturn
(
ProcessResult
(
10
5
,
0
,
'v0.1.2-3-1234abcd'
,
''
));
}
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
class
MockProcessUtils
extends
Mock
implements
ProcessUtils
{}
class
MockCache
extends
Mock
implements
Cache
{}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment