Blob Blame History Raw
From eac5be7d065df09e4e9271cedfb7ddf148a29a15 Mon Sep 17 00:00:00 2001
From: Jun Aruga <jaruga@redhat.com>
Date: Tue, 17 Aug 2021 18:21:06 +0200
Subject: [PATCH] Fix some failing Bundler tests with old Git.

Use the `git branch --list` rather than the `git branch -l` for better
compatibility. Because the `git branch -l` is used to create a new branch in
Git version < 2.20.0.
---
 bundler/spec/support/builders.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/spec/bundler/support/builders.rb b/spec/bundler/support/builders.rb
index 25377d2ac284..10beba1288dd 100644
--- a/spec/bundler/support/builders.rb
+++ b/spec/bundler/support/builders.rb
@@ -554,7 +554,7 @@ def _build(options)
           raise "You can't specify `master` as the branch" if branch == "master"
           escaped_branch = Shellwords.shellescape(branch)
 
-          if @context.git("branch -l #{escaped_branch}", libpath).empty?
+          if @context.git("branch --list #{escaped_branch}", libpath).empty?
             @context.git("branch #{escaped_branch}", libpath)
           end