diff --git a/pom.xml b/pom.xml index 25340a1c27..9e3d54993c 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ github-api - 1.78 + 1.79 GitHub API for Java http://github-api.kohsuke.org/ GitHub API for Java @@ -16,7 +16,7 @@ scm:git:git@github.com/kohsuke/${project.artifactId}.git scm:git:ssh://git@github.com/kohsuke/${project.artifactId}.git http://${project.artifactId}.kohsuke.org/ - github-api-1.78 + github-api-1.79 diff --git a/src/main/java/org/kohsuke/github/GHCommit.java b/src/main/java/org/kohsuke/github/GHCommit.java index 5872233567..3740778480 100644 --- a/src/main/java/org/kohsuke/github/GHCommit.java +++ b/src/main/java/org/kohsuke/github/GHCommit.java @@ -52,7 +52,7 @@ public GitUser getCommitter() { } public Date getCommitDate() { - return GitHub.parseDate(author.date); + return GitHub.parseDate(committer.date); } /** diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index 472adf41eb..2a16feb2f2 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -765,6 +765,10 @@ public GHRef[] getRefs(String refType) throws IOException { * invalid ref type being requested */ public GHRef getRef(String refName) throws IOException { + // hashes in branch names must be replaced with the url encoded equivalent or this call will fail + // FIXME: how about other URL unsafe characters, like space, @, : etc? do we need to be using URLEncoder.encode()? + // OTOH, '/' need no escaping + refName = refName.replaceAll("#", "%23"); return root.retrieve().to(String.format("/repos/%s/%s/git/refs/%s", owner.login, name, refName), GHRef.class).wrap(root); } /**