Skip to content

Commit

Permalink
Added option to prune or not
Browse files Browse the repository at this point in the history
  • Loading branch information
jaisejose1123 committed Jul 31, 2024
1 parent 714fafd commit 806afb6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/git_worktree.rb
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def checkout
end

def pull(prune: true)
lock { fetch_and_merge(:prune => prune) }
lock { fetch_and_merge(prune: prune) }
end

def with_remote_options
Expand Down Expand Up @@ -325,15 +325,15 @@ def local_ref
end

def fetch_and_merge(prune: true)
fetch(:prune => prune)
fetch(prune: prune)
commit = @repo.ref(upstream_ref).target
merge(commit)
end

def fetch(prune: true)
with_remote_options do |remote_options|
if prune
fetch_options = remote_options.merge(:prune => prune)
fetch_options = remote_options.merge(prune: prune)
@repo.fetch(@remote_name, **fetch_options)
else
@repo.fetch(@remote_name, **remote_options)
Expand Down

0 comments on commit 806afb6

Please sign in to comment.