[meld] meld.vc.git: Fix path for modified files from a subdir (bgo#738561)



commit b50f80ff9a8f6bb1c7706202a269370b57bc26fd
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Oct 26 07:26:02 2014 +1000

    meld.vc.git: Fix path for modified files from a subdir (bgo#738561)
    
    In _update_tree_state_cache(), we now go to some effort to get an
    absolute, unicode file path, assuming that we have paths relative to
    our location (i.e., not the repo root). However, our calls to git to
    get paths for modified and staged files were only limiting the returned
    files to the location that we're scanning, *not* returning paths
    relative to that location.
    
    This change simply adds the --relative flag before our existing path
    argument, which fixes the issue.

 meld/vc/git.py |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/meld/vc/git.py b/meld/vc/git.py
index e8caac1..23f982e 100644
--- a/meld/vc/git.py
+++ b/meld/vc/git.py
@@ -283,14 +283,16 @@ class Vc(_vc.CachedVc):
 
         # Get the status of files that are different in the "index" vs
         # the HEAD of the git repository
-        proc = _vc.popen([self.CMD, "diff-index",
-                          "--cached", "HEAD", path], cwd=self.location)
+        proc = _vc.popen(
+            [self.CMD, "diff-index", "--cached", "HEAD", "--relative", path],
+            cwd=self.location)
         entries = proc.read().split("\n")[:-1]
 
         # Get the status of files that are different in the "index" vs
         # the files on disk
-        proc = _vc.popen([self.CMD, "diff-files",
-                          "-0", path], cwd=self.location)
+        proc = _vc.popen(
+            [self.CMD, "diff-files", "-0", "--relative", path],
+            cwd=self.location)
         entries += (proc.read().split("\n")[:-1])
 
         # An unmerged file or a file that has been modified, added to


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]