Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
wants to merge 1 commit into from

2 participants

@EddieRingle

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 <eddie@eringle.net>
08e622d
@rtyley rtyley closed this pull request from a commit
@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

https://github.com/rtyley/agit/commits/master
0b20f71

To take us to the correct rnch or commit in Agit if the repo already exists...
0305e6d
@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 authored
    …nothing more.
    
    Signed-off-by: Eddie Ringle <eddie@eringle.net>
This page is out of date. Refresh to see the latest.
View
9 agit/src/main/java/com/madgag/agit/weblaunchers/GitHubWebLaunchActivity.java
@@ -13,8 +13,11 @@
private static final String TAG = "WL-github";
Intent cloneLauncherForWebBrowseIntent(Uri uri) {
- return cloneLauncherIntentFor("git://github.com"+ 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://github.com/"+ path +".git");
}
-
-
}
Something went wrong with that request. Please try again.