X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/8c737ba4564389ca40f2309e299f37ed1fb79249..cfafb9451a0a0704af4eea997ec91df83bf9e720:/stgit/git.py 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):