diff options
author | Vincent Ambo <tazjin@google.com> | 2020-05-24T00·36+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-05-24T01·13+0100 |
commit | 06d7b4aebd9e4a1a87f77fe59a8c08392318be5d (patch) | |
tree | 264bfbef18b5b93596d6eb805fc9e5647ddadb4b /third_party/nix/src/libexpr/primops/fetchMercurial.cc | |
parent | 10481d25861f1c25b53cfbd8119199ef2e918f9f (diff) |
refactor(3p/nix/libutil): Replace chomp() with absl::strings r/835
Diffstat (limited to 'third_party/nix/src/libexpr/primops/fetchMercurial.cc')
-rw-r--r-- | third_party/nix/src/libexpr/primops/fetchMercurial.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/third_party/nix/src/libexpr/primops/fetchMercurial.cc b/third_party/nix/src/libexpr/primops/fetchMercurial.cc index 9223f1c3ca99..69ece06eacb9 100644 --- a/third_party/nix/src/libexpr/primops/fetchMercurial.cc +++ b/third_party/nix/src/libexpr/primops/fetchMercurial.cc @@ -1,6 +1,7 @@ #include <nlohmann/json.hpp> #include <regex> +#include <absl/strings/ascii.h> #include <glog/logging.h> #include <sys/time.h> @@ -43,7 +44,8 @@ HgInfo exportMercurial(ref<Store> store, const std::string& uri, HgInfo hgInfo; hgInfo.rev = "0000000000000000000000000000000000000000"; - hgInfo.branch = chomp(runProgram("hg", true, {"branch", "-R", uri})); + hgInfo.branch = absl::StripTrailingAsciiWhitespace( + runProgram("hg", true, {"branch", "-R", uri})); auto files = tokenizeString<std::set<std::string>>( runProgram("hg", true, |