Method: MGit::Repo::SyncHelper.sync_exist_repo

Defined in:
lib/m-git/repo/sync_helper.rb

.sync_exist_repo(repo, light_repo) ⇒ string

同步已有仓库

Parameters:

Returns:

  • (string)

    执行结果,成功返回nil,错误返回错误信息



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/m-git/repo/sync_helper.rb', line 102

def sync_exist_repo(repo, light_repo)
  msg = ''

  if light_repo.lock
    # 同步锁定点
    error_message = sync_lock_point(repo, light_repo)
    msg += error_message + "\n" if !error_message.nil?
  end

  # 同步remote url
  error_message = sync_remote_url(repo, light_repo)
  msg += error_message + "\n" if !error_message.nil?

  return msg.length > 0 ? msg : nil
end