Project

General

Profile

repository.fetch_changesets in plugin

Added by Михаил Михайлов almost 6 years ago

Hello! I am writing a git integration plugin. The following problem appeared. How can I execute repository.fetch_changesets in a ruby file in the plugin code?

def index
        if Setting.plugin_gituniversalsync['api_key'] == params[:key] 
            repository = find_repository
            p repository.inspect
            git_success = update_repository(repository)
            if git_success
                # Fetch the new changesets into Redmine
                repository.fetch_changesets
                render(:text => 'OK', :status => :ok)
            else
                render(:text => "Git command failed on repository: #{repository.identifier}!", :status => :not_acceptable)
            end
        else
            raise ActionController::RoutingError.new('Not Found')
        end
   end

git pull and git autocreate works fine but repository.fetch_changesets and Repository.fetch_changesets not work for me. Why?
How can i proccess fetch_changesets in plugin controller?
Sorry for my English.


Replies (1)

RE: repository.fetch_changesets in plugin - Added by Михаил Михайлов almost 6 years ago

Not relevant anymore. I was tormented for several hours only because I forgot to restart redmine (touch tmp / restart.txt)

Looks pretty tired already. It's time to relax)))

    (1-1/1)