Method: MGit::Repo::SyncHelper.sync_commit_id

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

.sync_commit_id(repo, light_repo) ⇒ string

同步commit id

Parameters:

Returns:

  • (string)

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



163
164
165
166
167
168
169
170
# File 'lib/m-git/repo/sync_helper.rb', line 163

def sync_commit_id(repo, light_repo)
  if !light_repo.commit_id.nil?
    success, output = repo.execute_git_cmd('checkout', light_repo.commit_id)
    return output if !success
  else
    return "\"#{repo.path}\"的仓库配置未指定commit id!"
  end
end