You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Koch (JIRA)" <ji...@codehaus.org> on 2013/05/18 21:18:53 UTC

[jira] (SCM-709) REGRESSION: git status doesn't work if repository root is not the working directory

     [ https://jira.codehaus.org/browse/SCM-709?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Koch updated SCM-709:
-----------------------------

    Attachment: 0001-use-new-File-.toURI-to-fix-handling-of-paths-with-sp.patch

The current 1.9-SNAPSHOT fails in {{GitStatusCommand.executeStatusCommand}} line 68 if there are spaces in the directory path.

{noformat}
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4.1:prepare (default-cli) on project codequality: An error occurred during the status check process: Exception while executing SCM command. Illegal character in path at index 29: /home/michael/Projekte/JGloss Test -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4.1:prepare (default-cli) on project codequality: An error occurred during the status check process: Exception while executing SCM command.
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
[snip]
Caused by: java.lang.IllegalArgumentException: Illegal character in path at index 29: /home/michael/Projekte/JGloss Test
	at java.net.URI.create(URI.java:859)
	at org.apache.maven.scm.provider.git.gitexe.command.status.GitStatusCommand.executeStatusCommand(GitStatusCommand.java:68)
	at org.apache.maven.scm.command.status.AbstractStatusCommand.executeCommand(AbstractStatusCommand.java:44)
	at org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:59)
	... 31 more
Caused by: java.net.URISyntaxException: Illegal character in path at index 29: /home/michael/Projekte/JGloss Test
	at java.net.URI$Parser.fail(URI.java:2829)
{noformat}

This is because {{URI.create}} does not handle spaces. Using {{new File(path).toURI()}} instead fixes this bug. The {{GitAddCommand}} and {{GitCheckInCommand}} should also be affected, though I haven't tested it. I've attached a patch which fixes all occurrences.
                
> REGRESSION: git status doesn't work if repository root is not the working directory
> -----------------------------------------------------------------------------------
>
>                 Key: SCM-709
>                 URL: https://jira.codehaus.org/browse/SCM-709
>             Project: Maven SCM
>          Issue Type: Bug
>          Components: maven-scm-provider-git
>    Affects Versions: 1.8, 1.8.1
>            Reporter: Robert Scholte
>            Assignee: Robert Scholte
>            Priority: Blocker
>         Attachments: 0001-use-new-File-.toURI-to-fix-handling-of-paths-with-sp.patch
>
>
> SCM-686 introduced the {{--porcelain}} option to make the {{status}} result language independend.
> Without the {{--porcelain}} option files were listed relative to the working directory, but with {{--porcelain}} files are listed relative to the repository root. In most cases these are the same, but not always.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira