Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1309)

Unified Diff: lib/src/git.dart

Issue 2256623003: Fix more strong mode errors and warnings. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/flutter.dart ('k') | lib/src/io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/git.dart
diff --git a/lib/src/git.dart b/lib/src/git.dart
index 3877ee2161c8c650845aa1bf7b52a534c07af1ec..a7f8d79c61053ee5ff3bbe51bc76b28b38352988 100644
--- a/lib/src/git.dart
+++ b/lib/src/git.dart
@@ -42,21 +42,21 @@ bool _isInstalledCache;
/// Returns the stdout as a list of strings if it succeeded. Completes to an
/// exception if it failed.
Future<List<String>> run(List<String> args,
- {String workingDir, Map<String, String> environment}) {
+ {String workingDir, Map<String, String> environment}) async {
if (!isInstalled) {
fail("Cannot find a Git executable.\n"
"Please ensure Git is correctly installed.");
}
log.muteProgress();
- return runProcess(command, args, workingDir: workingDir,
- environment: environment).then((result) {
+ try {
+ var result = await runProcess(command, args, workingDir: workingDir,
+ environment: environment);
if (!result.success) throw new GitException(args, result.stderr.join("\n"));
-
return result.stdout;
- }).whenComplete(() {
+ } finally {
log.unmuteProgress();
- });
+ }
}
/// Like [run], but synchronous.
« no previous file with comments | « lib/src/flutter.dart ('k') | lib/src/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698