Unverified Commit 9dedbe52 authored by boklm's avatar boklm
Browse files

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`.
parent 8c773150
Loading
Loading
Loading
Loading
+1 −0
Changes for lib/RBM.pm: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -427,6 +427,7 @@ sub git_need_fetch {
        my ($stdout, undef, $success) = capture_exec('git', 'rev-parse',
                                        '--verify', "$git_hash^{commit}");
        return 1 unless $success;
        chomp $stdout;
        # If rev-parse returns the same as git_hash, then git_hash is
        # a hash and there is no need to fetch
        return 0 if $stdout eq $git_hash;