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.
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);