Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/main/java/org/kohsuke/github/GHTreeBuilder.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.kohsuke.github;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import java.io.IOException;
Expand All @@ -16,8 +18,10 @@ public class GHTreeBuilder {

private final List<TreeEntry> treeEntries = new ArrayList<TreeEntry>();

@JsonInclude(Include.NON_NULL)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@JsonInclude(Include.NON_NULL)
// Issue #636: Create Tree no longer accepts null value in sha field
@JsonInclude(Include.NON_NULL)

@SuppressFBWarnings("URF_UNREAD_FIELD")
private static final class TreeEntry {

private final String path;
private final String mode;
private final String type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"method": "POST",
"bodyPatterns": [
{
"equalToJson": "{\"base_tree\":\"737e00d471104660a7e8177fd5deb58fc46bbbec\",\"tree\":[{\"path\":\"app/run.sh\",\"mode\":\"100755\",\"type\":\"blob\",\"sha\":\"e9ba7ba07276a794d493db90e0384940ce2b757b\",\"content\":null},{\"path\":\"doc/readme.txt\",\"mode\":\"100644\",\"type\":\"blob\",\"sha\":\"fbbc875b17d1e17da06b4ee8fda46e2596c41f3c\",\"content\":null},{\"path\":\"data/val1.dat\",\"mode\":\"100644\",\"type\":\"blob\",\"sha\":\"aed2973e4b8a7ff1b30ff5c4751e5a2b38989e74\",\"content\":null},{\"path\":\"data/val2.dat\",\"mode\":\"100644\",\"type\":\"blob\",\"sha\":\"5bd8bb897b13225c93a1d26baa88c96b7bd5d817\",\"content\":null}]}",
"equalToJson": "{\"base_tree\":\"737e00d471104660a7e8177fd5deb58fc46bbbec\",\"tree\":[{\"path\":\"app/run.sh\",\"mode\":\"100755\",\"type\":\"blob\",\"sha\":\"e9ba7ba07276a794d493db90e0384940ce2b757b\"},{\"path\":\"doc/readme.txt\",\"mode\":\"100644\",\"type\":\"blob\",\"sha\":\"fbbc875b17d1e17da06b4ee8fda46e2596c41f3c\"},{\"path\":\"data/val1.dat\",\"mode\":\"100644\",\"type\":\"blob\",\"sha\":\"aed2973e4b8a7ff1b30ff5c4751e5a2b38989e74\"},{\"path\":\"data/val2.dat\",\"mode\":\"100644\",\"type\":\"blob\",\"sha\":\"5bd8bb897b13225c93a1d26baa88c96b7bd5d817\"}]}",
"ignoreArrayOrder": true,
"ignoreExtraElements": true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"method": "POST",
"bodyPatterns": [
{
"equalToJson": "{\"base_tree\":\"c2066e756eb2185ed12419f790af4375c8b91e7b\",\"tree\":[{\"path\":\"data/val1.dat\",\"mode\":\"100644\",\"type\":\"blob\",\"sha\":\"aed2973e4b8a7ff1b30ff5c4751e5a2b38989e74\",\"content\":null},{\"path\":\"data/val2.dat\",\"mode\":\"100644\",\"type\":\"blob\",\"sha\":\"5bd8bb897b13225c93a1d26baa88c96b7bd5d817\",\"content\":null}]}",
"equalToJson": "{\"base_tree\":\"c2066e756eb2185ed12419f790af4375c8b91e7b\",\"tree\":[{\"path\":\"data/val1.dat\",\"mode\":\"100644\",\"type\":\"blob\",\"sha\":\"aed2973e4b8a7ff1b30ff5c4751e5a2b38989e74\"},{\"path\":\"data/val2.dat\",\"mode\":\"100644\",\"type\":\"blob\",\"sha\":\"5bd8bb897b13225c93a1d26baa88c96b7bd5d817\"}]}",
"ignoreArrayOrder": true,
"ignoreExtraElements": true
}
Expand Down