From 4f2d4022dca65da2a6f03e1f27df13deeaab360a Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 6 Aug 2018 22:15:05 +0300 Subject: Add git version check (2.12 is minimum supported) --- bdep/git.ixx | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-) (limited to 'bdep/git.ixx') diff --git a/bdep/git.ixx b/bdep/git.ixx index e71375a..9369564 100644 --- a/bdep/git.ixx +++ b/bdep/git.ixx @@ -2,43 +2,31 @@ // copyright : Copyright (c) 2014-2018 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file -using namespace butl; - namespace bdep { - template - inline void - run_git (const dir_path& repo, A&&... args) + template + inline process + start_git (const dir_path& repo, I&& in, O&& out, E&& err, A&&... args) { - return run ("git", "-C", repo, forward (args)...); + return start_git (forward (in), + forward (out), + forward (err), + "-C", repo, + forward (args)...); } - template - inline process - start_git (I&& in, O&& out, E&& err, const dir_path& repo, A&&... args) + inline void + finish_git (process& pr, bool io_read) { - return start (forward (in), - forward (out), - forward (err), - "git", - "-C", repo, - forward (args)...); + finish ("git", pr, io_read); } template inline optional git_line (const dir_path& repo, bool ie, A&&... args) { - fdpipe pipe (fdopen_pipe ()); - auto_fd null (ie ? fdnull () : auto_fd ()); - - process pr (start (0 /* stdin */, - pipe /* stdout */, - ie ? null.get () : 2 /* stderr */, - "git", - "-C", repo, - forward (args)...)); - - return git_line (move (pr), move (pipe), ie); + return git_line (ie, + "-C", repo, + forward (args)...); } } -- cgit v1.1