Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10515: 0001-Bugfix-Git-scm-sync-method-ignored-value-of-scm.patch

File 0001-Bugfix-Git-scm-sync-method-ignored-value-of-scm.patch, 2.4 kB (added by grempe, 9 months ago)
  • a/lib/capistrano/recipes/deploy/scm/git.rb

    old new  
    125125        # Merges the changes to 'head' since the last fetch, for remote_cache 
    126126        # deployment strategy 
    127127        def sync(revision, destination) 
    128           execute = "cd #{destination} && git fetch origin && " 
     128          git = command 
     129 
     130          execute = "cd #{destination} && #{git} fetch origin && " 
    129131 
    130132          if head == 'HEAD' 
    131             execute += "git merge origin/HEAD" 
     133            execute += "#{git} merge origin/HEAD" 
    132134          else 
    133             execute += "git merge #{head}" 
     135            execute += "#{git} merge #{head}" 
    134136          end 
    135137 
    136138          execute 
  • a/test/deploy/scm/git_test.rb

    old new  
    5656    # With branch 
    5757    @config[:branch] = "origin/foo" 
    5858    assert_equal "cd #{dest} && git fetch origin && git merge origin/foo", @source.sync('Not used', dest) 
     59 
     60    # With :scm_command 
     61    @config[:scm_command] = "/opt/local/bin/git" 
     62    assert_equal "cd #{dest} && /opt/local/bin/git fetch origin && /opt/local/bin/git merge origin/foo", @source.sync('Not used', dest) 
    5963  end 
    6064 
    6165  def test_shallow_clone