chiark / gitweb /
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 ad9105bacbfd20444ccc465fd9d8a9e4c7f6d76c..e9913e9ee738c8025ef3eddaaaa927ea96dd6748 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 e97288a22edba108e4dc56e0bdfad80636b34f43..04d600ab18303e595f93af3120e44d688be48aa6 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 ebbff64953d6f153f22100179a22f9c33b71ff05..2faac4f3b2ce790ef27a921ad1743dd7bdb3feaa 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):