From cfafb9451a0a0704af4eea997ec91df83bf9e720 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Mon, 11 Jul 2005 18:47:48 +0100 Subject: [PATCH] Update the git cache for the resolved file Organization: Straylight/Edgeware From: Catalin Marinas Signed-off-by: Catalin Marinas --- ChangeLog | 3 +++ stgit/git.py | 9 +++++++++ stgit/main.py | 1 + 3 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index ad9105b..e9913e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2005-07-11 Catalin Marinas + * 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 diff --git a/stgit/git.py b/stgit/git.py index e97288a..04d600a 100644 --- a/stgit/git.py +++ b/stgit/git.py @@ -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): diff --git a/stgit/main.py b/stgit/main.py index ebbff64..2faac4f 100644 --- a/stgit/main.py +++ b/stgit/main.py @@ -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): -- [mdw]