From: Catalin Marinas Date: Mon, 11 Jul 2005 17:47:48 +0000 (+0100) Subject: Update the git cache for the resolved file X-Git-Tag: v0.5~32 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/cfafb9451a0a0704af4eea997ec91df83bf9e720 Update the git cache for the resolved file Signed-off-by: Catalin Marinas --- 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):