Skip to content

Commit 17bac7a

Browse files
committed
ci: fix github action commit error
1 parent 8dd9502 commit 17bac7a

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

lib/src/git_workflow.dart

-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import 'dart:io';
21
import 'dart:math';
32
import 'package:path/path.dart';
43
import 'package:verbose/verbose.dart';
@@ -335,8 +334,6 @@ class GitWorkflow {
335334
} catch (applyError) {
336335
verbose('Error while restoring changes:');
337336
verbose(applyError.toString());
338-
verbose(
339-
'Content of file $unstagedPatch is:\n${File(unstagedPatch).readAsStringSync()}');
340337
verbose('Retrying with 3-way merge');
341338
try {
342339
// Retry with a 3-way merge if normal apply fails

test/integration/git_submodules_test.dart

+9-8
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,30 @@ void main() {
4545
allowEmpty: true, gitCommitArgs: ['-m', 'Add submodule']),
4646
completes);
4747

48-
final submoduleDir = join(project.dir, 'submodule');
48+
final submodulePath = join(project.dir, 'submodule');
4949
await writeFile('pubspec.yaml', kConfigFormatExit,
50-
workingDirectory: submoduleDir);
50+
workingDirectory: submodulePath);
5151

5252
/// Stage pretty file
5353
await appendFile('lib/main.dart', kFormattedDart,
54-
workingDirectory: submoduleDir);
55-
await execGit(['add', '.'], workingDirectory: submoduleDir);
54+
workingDirectory: submodulePath);
55+
await execGit(['add', '.'], workingDirectory: submodulePath);
5656

5757
/// Run lint_staged with `dart format --set-exit-if-changed` and commit formatted file
58+
await project.config(submodulePath);
5859
await expectLater(
59-
project.gitCommit(workingDirectory: submoduleDir), completes);
60+
project.gitCommit(workingDirectory: submodulePath), completes);
6061

6162
/// Nothing is wrong, so a new commit is created
6263
expect(
6364
await execGit(['rev-list', '--count', 'HEAD'],
64-
workingDirectory: submoduleDir),
65+
workingDirectory: submodulePath),
6566
equals('2'));
6667
expect(
6768
await execGit(['log', '-1', '--pretty=%B'],
68-
workingDirectory: submoduleDir),
69+
workingDirectory: submodulePath),
6970
contains('test'));
70-
expect(await readFile('lib/main.dart', workingDirectory: submoduleDir),
71+
expect(await readFile('lib/main.dart', workingDirectory: submodulePath),
7172
equals(kFormattedDart));
7273

7374
/// Commit this submodule

test/integration/utils.dart

+11-4
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,23 @@ class IntegrationProject {
1818
await git.execGit(['init', dir]);
1919

2020
/// Git config
21-
await execGit(['config', 'user.name', 'test']);
22-
await execGit(['config', 'user.email', '[email protected]']);
23-
await execGit(['config', 'commit.gpgsign', 'false']);
24-
await execGit(['config', 'merge.conflictstyle', 'merge']);
21+
await config(dir);
2522

2623
if (initialCommit) {
2724
await _initialCommit();
2825
}
2926
}
3027

28+
Future<void> config(String dir) async {
29+
await git.execGit(['config', 'user.name', 'test'], workingDirectory: dir);
30+
await git.execGit(['config', 'user.email', '[email protected]'],
31+
workingDirectory: dir);
32+
await git
33+
.execGit(['config', 'commit.gpgsign', 'false'], workingDirectory: dir);
34+
await git.execGit(['config', 'merge.conflictstyle', 'merge'],
35+
workingDirectory: dir);
36+
}
37+
3138
Future<void> _initialCommit() async {
3239
await appendFile('README.md', '# Test\n');
3340
await execGit(['add', 'README.md']);

0 commit comments

Comments
 (0)