Changeset 0395beaa5088…
Parent bd8f5ebeb023…
by
Changes to one file · Browse files at 0395beaa5088 Showing diff from parent bd8f5ebeb023 Diff from another changeset...
@@ -63,16 +63,15 @@ const kilnUrlSuffix = "kiln/"
func extractUrlsAndPaths(s string) (base *url.URL, path string, err error) {
- base, err = url.Parse(s)
- if err != nil || (base.Scheme != "http" && base.Scheme != "https") {
- out, err := exec.Command("git", "config", "kiln.url").Output()
- if err == nil {
- base, err = url.Parse(strings.TrimSpace(string(out)))
- }
- }
- if err != nil || (base.Scheme != "http" && base.Scheme != "https") {
- err = fmt.Errorf("must either have an HTTP remote or kiln.url specified in config")
- return
+ out, err := exec.Command("git", "config", "kiln.url").Output()
+ if err == nil && len(out) > 0 {
+ base, err = url.Parse(strings.TrimSpace(string(out)))
+ } else {
+ base, err = url.Parse(s)
+ if err != nil || (base.Scheme != "http" && base.Scheme != "https") {
+ err = fmt.Errorf("must either have an HTTP remote or kiln.url specified in config")
+ return
+ }
}
components := strings.Split(base.Path, "/")
|
Loading...