From 7c665d965c0ebb259849d5032faa0854c6ae94f2 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 6 Aug 2018 21:24:27 +0300 Subject: Add git utility functions --- libbutl/git.mxx | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 libbutl/git.mxx (limited to 'libbutl/git.mxx') diff --git a/libbutl/git.mxx b/libbutl/git.mxx new file mode 100644 index 0000000..b2023a6 --- /dev/null +++ b/libbutl/git.mxx @@ -0,0 +1,46 @@ +// file : libbutl/git.mxx -*- C++ -*- +// copyright : Copyright (c) 2014-2018 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +#ifndef __cpp_modules +#pragma once +#endif + +// C includes. + +#ifndef __cpp_lib_modules +#include +#endif + +// Other includes. + +#ifdef __cpp_modules +export module butl.curl; +#ifdef __cpp_lib_modules +import std.core; +#endif +import butl.path; +import butl.optional; +import butl.standard_version +#else +#include +#include +#include +#endif + +#include + +LIBBUTL_MODEXPORT namespace butl +{ + // Return true if the specified directory is a git repository root (contains + // the .git filesystem entry). + // + LIBBUTL_SYMEXPORT bool + git_repository (const dir_path&); + + // Try to parse the line printed by the 'git --version' command. Return git + // version if succeed, nullopt otherwise. + // + LIBBUTL_SYMEXPORT optional + git_version (const std::string&); +} -- cgit v1.1