diff --git a/bitbucket.go b/bitbucket.go index a081767..bbe1810 100644 --- a/bitbucket.go +++ b/bitbucket.go @@ -214,6 +214,10 @@ type RepositoryRefOptions struct { BranchFlg bool } +type RepositoryRefTarget struct { + Hash string `json:"hash"` +} + type RepositoryBranchOptions struct { Owner string `json:"owner"` RepoSlug string `json:"repo_slug"` @@ -226,14 +230,10 @@ type RepositoryBranchOptions struct { } type RepositoryBranchCreationOptions struct { - Owner string `json:"owner"` - RepoSlug string `json:"repo_slug"` - Name string `json:"name"` - Target RepositoryBranchTarget `json:"target"` -} - -type RepositoryBranchTarget struct { - Hash string `json:"hash"` + Owner string `json:"owner"` + RepoSlug string `json:"repo_slug"` + Name string `json:"name"` + Target RepositoryRefTarget `json:"target"` } type RepositoryTagOptions struct { @@ -251,11 +251,7 @@ type RepositoryTagCreationOptions struct { Owner string `json:"owner"` RepoSlug string `json:"repo_slug"` Name string `json:"name"` - Target RepositoryTagTarget `json:"target"` -} - -type RepositoryTagTarget struct { - Hash string `json:"hash"` + Target RepositoryRefTarget `json:"target"` } type PullRequestsOptions struct {