From b179259d6ff6344570e4c3de0c3b55d280547e62 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman Date: Thu, 24 Apr 2025 22:27:03 +0000 Subject: [PATCH] libutil: Use correct argument to Error format ctor It seems that the intention was to format a number in base 8 (as suggested by the %o format specifier), but `perms` is a `std::string` and not a number. Looks like `rawMode` is the correct thing to use here. (cherry picked from commit 1b5c8aac123d96b907972a9cbb67891ff17caf7a) --- src/libutil/git.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libutil/git.cc b/src/libutil/git.cc index 45cda1c2c..edeef71b7 100644 --- a/src/libutil/git.cc +++ b/src/libutil/git.cc @@ -134,7 +134,7 @@ void parseTree( RawMode rawMode = std::stoi(perms, 0, 8); auto modeOpt = decodeMode(rawMode); if (!modeOpt) - throw Error("Unknown Git permission: %o", perms); + throw Error("Unknown Git permission: %o", rawMode); auto mode = std::move(*modeOpt); std::string name = getStringUntil(source, '\0');