You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2013/01/19 13:40:35 UTC

[1/2] git commit: [SCM-709] REGRESSION: git status doesn't work if repository root is not the working directory

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


Project: http://git-wip-us.apache.org/repos/asf/maven-scm/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-scm/commit/6aff3431
Tree: http://git-wip-us.apache.org/repos/asf/maven-scm/tree/6aff3431
Diff: http://git-wip-us.apache.org/repos/asf/maven-scm/diff/6aff3431

Branch: refs/heads/master
Commit: 6aff3431817108139d29914dc81d8d2dc53e3c6a
Parents: fa8674c
Author: rfscholte <rf...@apache.org>
Authored: Sat Jan 19 13:38:17 2013 +0100
Committer: rfscholte <rf...@apache.org>
Committed: Sat Jan 19 13:38:17 2013 +0100

----------------------------------------------------------------------
 .../gitexe/command/status/GitStatusConsumer.java   |   22 +++++++++-----
 1 files changed, 14 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-scm/blob/6aff3431/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusConsumer.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusConsumer.java b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusConsumer.java
index d785039..cf37c08 100644
--- a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusConsumer.java
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusConsumer.java
@@ -135,39 +135,39 @@ public class GitStatusConsumer
                 {
                     String oldFilePath = files.get( 0 );
                     String newFilePath = files.get( 1 );
-                    if ( new File( workingDirectory, oldFilePath ).isFile() )
+                    if ( isFile( oldFilePath ) )
                     {
                         logger.debug(
-                            "file '" + new File( workingDirectory, oldFilePath ).getAbsolutePath() + "' is a file" );
+                            "file '" + oldFilePath + "' is a file" );
                         return;
                     }
                     else
                     {
                         logger.debug(
-                            "file '" + new File( workingDirectory, oldFilePath ).getAbsolutePath() + "' not a file" );
+                            "file '" + oldFilePath + "' not a file" );
                     }
-                    if ( !new File( workingDirectory, newFilePath ).isFile() )
+                    if ( !isFile( newFilePath ) )
                     {
                         logger.debug(
-                            "file '" + new File( workingDirectory, newFilePath ).getAbsolutePath() + "' not a file" );
+                            "file '" + newFilePath + "' not a file" );
                         return;
                     }
                     else
                     {
                         logger.debug(
-                            "file '" + new File( workingDirectory, newFilePath ).getAbsolutePath() + "' is a file" );
+                            "file '" + newFilePath + "' is a file" );
                     }
                 }
                 else if ( status == ScmFileStatus.DELETED )
                 {
-                    if ( new File( workingDirectory, files.get( 0 ) ).isFile() )
+                    if ( isFile( files.get( 0 ) ) )
                     {
                         return;
                     }
                 }
                 else
                 {
-                    if ( !new File( workingDirectory, files.get( 0 ) ).isFile() )
+                    if ( !isFile( files.get( 0 ) ) )
                     {
                         return;
                     }
@@ -181,6 +181,12 @@ public class GitStatusConsumer
         }
     }
 
+    private boolean isFile( String file )
+    {
+        return new File( workingDirectory, file ).isFile();
+//        return !file.endsWith( "/" );
+    }
+
     public List<ScmFile> getChangedFiles()
     {
         return changedFiles;