Skip to content


Make sure only the repository owner and name are taken from the GitHub path #29

wants to merge 1 commit into from

2 participants


I noticed that Agit will accept URLs such as EddieRingle/hubroid#66 and attempt to turn it into a Git URL. I haven't actually tried fetching from one of these URLs yet, but it doesn't look pretty. This patch should only use the first two segments from the path to form the Git URL.

I wasn't able to build or test, but things should be in order.

@EddieRingle EddieRingle Make sure we only get the repository owner and name out of the path, …
…nothing more.

Signed-off-by: Eddie Ringle <>
@rtyley rtyley added a commit that closed this pull request
@rtyley Fix #27 and close #29 - problems with github url parsing
(uri path starts with a slash, so path[0] is always empty)

In the future could add parsing for github urls like

To take us to the correct rnch or commit in Agit if the repo already exists...
@rtyley rtyley closed this in 0305e6d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 7, 2011
  1. @EddieRingle

    Make sure we only get the repository owner and name out of the path, …

    EddieRingle committed
    …nothing more.
    Signed-off-by: Eddie Ringle <>
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 3 deletions.
  1. +6 −3 agit/src/main/java/com/madgag/agit/weblaunchers/
9 agit/src/main/java/com/madgag/agit/weblaunchers/
@@ -13,8 +13,11 @@
private static final String TAG = "WL-github";
Intent cloneLauncherForWebBrowseIntent(Uri uri) {
- return cloneLauncherIntentFor("git://"+ uri.getPath() +".git");
+ final String[] pathParts = uri.getPath().split("/");
+ String path = uri.getPath();
+ if (pathParts.length >= 2) {
+ path = pathParts[0] + "/" + pathParts[1];
+ }
+ return cloneLauncherIntentFor("git://"+ path +".git");
Something went wrong with that request. Please try again.