Bug 40082: Fix `fetch: if_needed` to avoid fetching when using a fixed commit
Remove trailing newline from output of git rev-parse when comparing
it with git_hash.
Tested with this command ./rbm/rbm showconf --target torbrowser-linux-x86_64 --target nightly llvm-project filename, and this change to check that git fetch is not being run:
diff --git a/lib/RBM.pm b/lib/RBM.pm
index f01e5c8..0fbe9b3 100644
--- a/lib/RBM.pm
+++ b/lib/RBM.pm
@@ -477,6 +477,7 @@ sub git_clone_fetch_chdir {
|| exit_error "Error running git checkout --detach";
}
for my $fetch_ref (@fetch_refs) {
+ print "Running git fetch for project $project\n";
system('git', 'fetch', @fetch_opts, 'origin', $fetch_ref) == 0
|| exit_error "Error fetching $fetch_ref from git repository $git_url";
/closes #40082 (closed)