Update the git cache for the resolved file
authorCatalin Marinas <catalin.marinas@gmail.com>
Mon, 11 Jul 2005 17:47:48 +0000 (18:47 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Mon, 11 Jul 2005 17:47:48 +0000 (18:47 +0100)
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
ChangeLog
stgit/git.py
stgit/main.py

index ad9105b..e9913e9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2005-07-11  Catalin Marinas  <catalin.marinas@gmail.com>
 
+       * stgit/main.py (__resolved): Run git-update-cache for the
+       resolved files
+
        * gitmergeonefile.py: Fix the os.rename exception occurring when
        the checkout directory is not present
 
index e97288a..04d600a 100644 (file)
@@ -210,6 +210,15 @@ def rm(files, force = False):
             if os.system('git-update-cache --remove -- %s' % f) != 0:
                 raise GitException, 'Unable to remove %s' % f
 
+def update_cache(files):
+    """Update the cache information for the given files
+    """
+    for f in files:
+        if os.path.exists(f):
+            os.system('git-update-cache -- %s' % f)
+        else:
+            os.system('git-update-cache --remove -- %s' % f)
+
 def commit(message, files = [], parents = [], allowempty = False,
            author_name = None, author_email = None, author_date = None,
            committer_name = None, committer_email = None):
index ebbff64..2faac4f 100644 (file)
@@ -527,6 +527,7 @@ pop_cmd = \
 
 
 def __resolved(filename):
+    git.update_cache([filename])
     for ext in ['.local', '.older', '.remote']:
         fn = filename + ext
         if os.path.isfile(fn):