direct: use local branch name, instead of remote
If we fetch only one commit and force fetch the branch to local, it seems that the remote head ref is not actually set. So, we should just use the local version anyway, as it's updated.
This commit is contained in:
@@ -211,7 +211,7 @@ func processConfiguredPushAction(action *common.PushWebhookEvent, config *common
|
||||
common.LogError("Error fetching branch:", branch, "Ignoring as non-existent.", err)
|
||||
return
|
||||
}
|
||||
id, err := git.GitRemoteHead(filepath.Join(gitPrj, action.Repository.Name), "origin", branch)
|
||||
id, err := git.GitBranchHead(filepath.Join(gitPrj, action.Repository.Name), branch)
|
||||
common.PanicOnError(err)
|
||||
if action.Head_Commit.Id == id {
|
||||
git.GitExecOrPanic(filepath.Join(gitPrj, action.Repository.Name), "checkout", id)
|
||||
|
||||
Reference in New Issue
Block a user