Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 89aac45

Browse filesBrowse files
committed
Merge pull request hub4j#299
2 parents 87fbb8e + 4965fd5 commit 89aac45
Copy full SHA for 89aac45

File tree

Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed

‎src/main/java/org/kohsuke/github/GHRepository.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHRepository.java
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,10 @@ public GHRef[] getRefs(String refType) throws IOException {
765765
* invalid ref type being requested
766766
*/
767767
public GHRef getRef(String refName) throws IOException {
768+
// hashes in branch names must be replaced with the url encoded equivalent or this call will fail
769+
// FIXME: how about other URL unsafe characters, like space, @, : etc? do we need to be using URLEncoder.encode()?
770+
// OTOH, '/' need no escaping
771+
refName = refName.replaceAll("#", "%23");
768772
return root.retrieve().to(String.format("/repos/%s/%s/git/refs/%s", owner.login, name, refName), GHRef.class).wrap(root);
769773
}
770774
/**

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.