aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers/git-utils.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-05-02 13:37:53 +0200
committerEelco Dolstra <edolstra@gmail.com>2022-05-02 13:37:53 +0200
commit61289ceee3417cd2aa8e8db9fe117a5813969aed (patch)
treebb4b7b5f43a31e6a6171f156d8465b6c36fa7a10 /src/libfetchers/git-utils.cc
parent564faa6b4e568f5d1da2b92909aecd2c4eccc26c (diff)
Style fixes
Diffstat (limited to 'src/libfetchers/git-utils.cc')
-rw-r--r--src/libfetchers/git-utils.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libfetchers/git-utils.cc b/src/libfetchers/git-utils.cc
index 060077098..b2d6b7893 100644
--- a/src/libfetchers/git-utils.cc
+++ b/src/libfetchers/git-utils.cc
@@ -2,7 +2,8 @@
#include <regex>
-std::optional<std::string> parseListReferenceHeadRef(std::string_view line) {
+std::optional<std::string> parseListReferenceHeadRef(std::string_view line)
+{
const static std::regex head_ref_regex("^ref: ([^\\s]+)\\t+HEAD$");
std::match_results<std::string_view::const_iterator> match;
if (std::regex_match(line.cbegin(), line.cend(), match, head_ref_regex)) {
@@ -12,7 +13,8 @@ std::optional<std::string> parseListReferenceHeadRef(std::string_view line) {
}
}
-std::optional<std::string> parseListReferenceForRev(std::string_view rev, std::string_view line) {
+std::optional<std::string> parseListReferenceForRev(std::string_view rev, std::string_view line)
+{
const static std::regex rev_regex("^([^\\t]+)\\t+(.*)$");
std::match_results<std::string_view::const_iterator> match;
if (!std::regex_match(line.cbegin(), line.cend(), match, rev_regex)) {