]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Let “ccache --hash-file” perform raw hashing again
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 18 Jun 2020 18:26:58 +0000 (20:26 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 18 Jun 2020 19:12:46 +0000 (21:12 +0200)
Unintended or not, #577 (213d9883) changed the behavior of “ccache
--hash-file” to use hash_binary_file, which essentially performs
hash(hash(path)) if the i-node cache is enabled, otherwise hash(path).
This means that “ccache --hash-file” behaves differently depending on if
i-node cache is enabled and also that it’s no longer usable for
benchmarking purposes.

Fix this by simply using “hash_file” again.

src/ccache.cpp

index 7d4f9aaec59b16a65a2b1dce97891e262b0e463e..41f1e633242eb07c25b9c986d1d0c280ef67413e 100644 (file)
@@ -2293,7 +2293,7 @@ handle_main_options(int argc, const char* const* argv)
       if (str_eq(optarg, "-")) {
         hash_fd(hash, STDIN_FILENO);
       } else {
-        hash_binary_file(ctx, hash, optarg);
+        hash_file(hash, optarg);
       }
       puts(hash_result(hash).to_string().c_str());
       hash_free(hash);