-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Handle Enterprise http urls #21
Conversation
Note that ToUri isn't used anywhere, so I replaced it.
Sadly we can't just do this: new Uri(url, path); because you get different results if the url ends with "/" or not. So we need to make absolutely sure it _does_ end with "/".
We no longer need this.
Fixes #13 We need to preserve the format of the origin for non github.com repositories (such as GitHub Enterprise instances). Many of them are not set up with HTTPS because they're behind a firewall etc.
We have some places where we used custom parsing logic for extracting owner and repo from a repository URL. Instead, we should use the robust logic from UriString.
I noticed this was no longer included in the project. Probably should be.
This method name makes more sense.
5112ae4
to
56add34
Compare
Let's not go overboard with C# 6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an advantage to doing this with the value type instead of the class type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. I think it's my overeager R# that does this. We should pick an approach and stick to it. Do you have a preference?
BTW, this has nothing to do with value type or class type. string
is just the shorthand for System.String
but it's the exact same class. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. I think it's my overeager R# that does this. We should pick an approach and stick to it. Do you have a preference?
Weeell, I always type String.Something out of habit, so I'm sure the code is way more sprinkled with the uppercase version than the lowercase one (and I doubt I can teach my fingers otherwise...) 😄
BTW, this has nothing to do with value type or class type. string is just the shorthand for System.String but it's the exact same class. 😄
Yeah, I keep forgetting we're in .NET land where there are no crazy peeps doing weird stuff with jit and string/String differences...
🍍 |
🍨 |
Fixes #13
This PR not only fixes #13, but consolidates all the URL parsing of repository information by leveraging the UriString class adapted from GHfW.