From 13ac42150b845f27f00c197f0ab7140cd1c5035a Mon Sep 17 00:00:00 2001 From: Matthew Riedel Date: Tue, 3 May 2022 14:33:45 +1200 Subject: [PATCH] Add --all flag to fetch method The fix for CVE-2022-25648 broke a workflow for us by removing the ability to fetch all remotes. This adds --all to the list of available flags for the #fetch method. It does not add :a as an alternative flag, as git fetch -a and git fetch --all are not the same thing. Signed-off-by: Matthew Riedel --- lib/git/lib.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/git/lib.rb b/lib/git/lib.rb index 5bf2e455..80195b31 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -877,15 +877,16 @@ def tag(name, *opts) def fetch(remote, opts) arr_opts = [] + arr_opts << '--all' if opts[:all] arr_opts << '--tags' if opts[:t] || opts[:tags] arr_opts << '--prune' if opts[:p] || opts[:prune] arr_opts << '--prune-tags' if opts[:P] || opts[:'prune-tags'] arr_opts << '--force' if opts[:f] || opts[:force] arr_opts << '--unshallow' if opts[:unshallow] arr_opts << '--depth' << opts[:depth] if opts[:depth] - arr_opts << '--' - arr_opts << remote - arr_opts << opts[:ref] if opts[:ref] + arr_opts << '--' unless opts[:all] + arr_opts << remote unless opts[:all] + arr_opts << opts[:ref] if opts[:ref] unless opts[:all] command('fetch', arr_opts) end pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy