-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trim on carriage return at svn.go func detectRemoteFromInfoCommand #102
Comments
The current code works only on Unix ( My suggestion would be to add this just before the existing return at line 384 in
i.e. "If the last character on a line is a carriage return then omit it". What worries me is how many other places in the code are parsing output from svn commands and trying to strip off the newline characters. If there are others then each one will need to be individually fixed in some similar fashion. In this case it would probably be better to create some sort of |
Or see 43e105a6f4 which fixes this a different way. |
The func detectRemoteFromInfoCommand(infoOut string) (string, error) returns a remote with a trailing "cariagge return".
If this remote is used the commands issued to svn will always respond with an error.
My solution ..
func detectRemoteFromInfoCommand(infoOut string) (string, error) {
sBytes := []byte(infoOut)
urlIndex := strings.Index(infoOut, "URL: ")
if urlIndex == -1 {
return "", fmt.Errorf("Remote not specified in svn info")
}
urlEndIndex := strings.Index(string(sBytes[urlIndex:]), "\n")
if urlEndIndex == -1 {
urlEndIndex = strings.Index(string(sBytes[urlIndex:]), "\r")
if urlEndIndex == -1 {
return "", fmt.Errorf("Unable to parse remote URL for svn info")
}
}
}
The text was updated successfully, but these errors were encountered: