File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed
Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -311,6 +311,7 @@ g.fetch
311311g.fetch(g.remotes.first)
312312g.fetch(' origin' , {:ref => ' some/ref/head' } )
313313g.fetch(all: true , force: true , depth: 2 )
314+ g.fetch(' origin' , {:'update-head-ok' => true })
314315
315316g.pull
316317g.pull(Git ::Repo , Git ::Branch ) # fetch and a merge
Original file line number Diff line number Diff line change @@ -951,6 +951,7 @@ def fetch(remote, opts)
951951 arr_opts << '--prune' if opts [ :p ] || opts [ :prune ]
952952 arr_opts << '--prune-tags' if opts [ :P ] || opts [ :'prune-tags' ]
953953 arr_opts << '--force' if opts [ :f ] || opts [ :force ]
954+ arr_opts << '--update-head-ok' if opts [ :u ] || opts [ :'update-head-ok' ]
954955 arr_opts << '--unshallow' if opts [ :unshallow ]
955956 arr_opts << '--depth' << opts [ :depth ] if opts [ :depth ]
956957 arr_opts << '--' if remote || opts [ :ref ]
Original file line number Diff line number Diff line change @@ -147,6 +147,13 @@ def test_fetch_cmd_with_all_with_other_args
147147 assert_command_line ( expected_command_line , git_cmd , git_cmd_args )
148148 end
149149
150+ def test_fetch_cmd_with_update_head_ok
151+ expected_command_line = [ 'fetch' , '--update-head-ok' ]
152+ git_cmd = :fetch
153+ git_cmd_args = [ :'update-head-ok' => true ]
154+ assert_command_line ( expected_command_line , git_cmd , git_cmd_args )
155+ end
156+
150157 def test_fetch_command_injection
151158 test_file = 'VULNERABILITY_EXISTS'
152159 vulnerability_exists = false
You can’t perform that action at this time.
0 commit comments