From ae5cab7489fe014dd3aa818cf2655d7a4714af83 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 16 Dec 2017 17:42:12 +0200 Subject: Improve process execution diagnostics by reusing run_*() API --- build2/version/snapshot-git.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'build2/version') 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 (args, [] (string& s) {return move (s);}).empty ()) + if (!run (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; -- cgit v1.1