aboutsummaryrefslogtreecommitdiff
path: root/src/libutil
diff options
context:
space:
mode:
authorThéophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>2022-04-08 17:56:27 +0200
committerGitHub <noreply@github.com>2022-04-08 17:56:27 +0200
commit646af7325d93f98802b989f8a8e008a25f7a4788 (patch)
tree6ffa1da45de1107a3b76dde8a227e72cf24b5db8 /src/libutil
parenta52e369c0737b27e3acde745932d6e12f5de2a3f (diff)
parent2c2fd4946f96e6839ecbfb4cf61318d8910e7e8f (diff)
Merge pull request #6376 from Uthar/master
don't assume that rev is a SHA1 hash
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/hash.cc2
-rw-r--r--src/libutil/hash.hh2
2 files changed, 1 insertions, 3 deletions
diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc
index a4d632161..d2fd0c15a 100644
--- a/src/libutil/hash.cc
+++ b/src/libutil/hash.cc
@@ -155,7 +155,7 @@ static std::pair<std::optional<HashType>, bool> getParsedTypeAndSRI(std::string_
{
bool isSRI = false;
- // Parse the has type before the separater, if there was one.
+ // Parse the hash type before the separator, if there was one.
std::optional<HashType> optParsedType;
{
auto hashRaw = splitPrefixTo(rest, ':');
diff --git a/src/libutil/hash.hh b/src/libutil/hash.hh
index 56b5938b3..00f70a572 100644
--- a/src/libutil/hash.hh
+++ b/src/libutil/hash.hh
@@ -93,13 +93,11 @@ public:
std::string gitRev() const
{
- assert(type == htSHA1);
return to_string(Base16, false);
}
std::string gitShortRev() const
{
- assert(type == htSHA1);
return std::string(to_string(Base16, false), 0, 7);
}