out := string(outb)
// Expect:
- // ...
- // Repository Root: <URL>
- // ...
-
- i := strings.Index(out, "\nRepository Root: ")
+ //
+ // ...
+ // URL: <URL>
+ // ...
+ //
+ // Note that we're not using the Repository Root line,
+ // because svn allows checking out subtrees.
+ // The URL will be the URL of the subtree (what we used with 'svn co')
+ // while the Repository Root may be a much higher parent.
+ i := strings.Index(out, "\nURL: ")
if i < 0 {
return "", fmt.Errorf("unable to parse output of svn info")
}
- out = out[i+len("\nRepository Root: "):]
+ out = out[i+len("\nURL: "):]
i = strings.Index(out, "\n")
if i < 0 {
return "", fmt.Errorf("unable to parse output of svn info")