aboutsummaryrefslogtreecommitdiff
path: root/build2/version
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-12-16 17:42:12 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-12-16 17:42:12 +0200
commitae5cab7489fe014dd3aa818cf2655d7a4714af83 (patch)
treea80fdc22ce5909b98bd58292aaf8e2bc28e70492 /build2/version
parent530e8914ba00ce0e7ee89ba30d2b88f2c09f43c9 (diff)
Improve process execution diagnostics by reusing run_*() API
Diffstat (limited to 'build2/version')
-rw-r--r--build2/version/snapshot-git.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/build2/version/snapshot-git.cxx b/build2/version/snapshot-git.cxx
index 9ff1cc9..bf863ce 100644
--- a/build2/version/snapshot-git.cxx
+++ b/build2/version/snapshot-git.cxx
@@ -30,7 +30,7 @@ namespace build2
{
const char* args[] {"git", "-C", d, "status", "--porcelain", nullptr};
- if (!run<string> (args, [] (string& s) {return move (s);}).empty ())
+ if (!run<string> (3, args, [](string& s) {return move (s);}).empty ())
return r;
}
@@ -49,7 +49,7 @@ namespace build2
const char* args[] {
"git", "-C", d, "cat-file", "commit", "HEAD", nullptr};
- process pr (run_start (args));
+ process pr (run_start (3 /* verbosity */, args, -1 /* stdout */));
try
{
@@ -116,7 +116,9 @@ namespace build2
// that.
}
- if (!run_finish (args, pr) || r.sn == 0)
+ run_finish (args, pr);
+
+ if (r.sn == 0)
fail << "unable to extract git commit id/date for " << src_root;
sha1 cs;