Esempio n. 1
0
func DeleteRemoteComment(repoPath, remoteName, commentID string) result.Result {
	return gg.WithRemote(repoPath, remoteName, func(remote *git.Remote) result.Result {
		return CreatePerson(gg.ConfiguredCommitter(repoPath)).Analysis(func(val interface{}) result.Result {
			sig := val.(*Person).Signature()
			refspec := fmt.Sprintf(":%v", commentID)
			return gg.Push(repoPath, remoteName, []string{refspec}, sig)
		}, func(err error) result.Result {
			return result.NewFailure(errors.New(noCommitterError))
		})
	})
}
Esempio n. 2
0
// Determine committer for comment preferring the committer string if
// available.
// @return result.Result<*Person, error>
func commentCommitter(repoPath, committer string) result.Result {
	if len(committer) > 0 {
		return CreatePerson(committer)
	}
	return CreatePerson(gg.ConfiguredCommitter(repoPath))
}