Skip to content

Commit

Permalink
Update the GitWorktree URL if it has changed
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Apr 8, 2024
1 parent 682dcf3 commit ebf2384
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/git_repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ def update_repo
with_worktree do |worktree|
message = "Updating #{url} in #{directory_name}..."
_log.info(message)
# If the remote url has changed set it to the new url
git_transaction { worktree.url = url } if worktree.url != url

# Fetch and rebase the git worktree
worktree.send(:pull)
_log.info("#{message}...Complete")
end
Expand Down

0 comments on commit ebf2384

Please sign in to comment.