Browse Source

Adding omitempty to base_tree in CreateTree API

A recent update to the GitHub API changed some undocumented behavior. Previously
a nonexistent base_tree and an empty string base_tree were treated the same, but
now the empty string case will fail with "422 base_tree is not a valid oid".
Rob Figueiredo 11 years ago
committed by Will Norris
parent
commit
1173b0b357
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      github/git_trees.go

+ 1
- 1
github/git_trees.go View File

@ -58,7 +58,7 @@ func (s *GitService) GetTree(owner string, repo string, sha string, recursive bo
// createTree represents the body of a CreateTree request.
type createTree struct {
BaseTree string `json:"base_tree"`
BaseTree string `json:"base_tree,omitempty"`
Entries []TreeEntry `json:"tree"`
}


Loading…
Cancel
Save