diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-11-05 20:09:35 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-11-05 20:09:35 +0100 |
commit | 46c9a0df4403266a320059eaa66e7dce7b3d9ac4 (patch) | |
tree | 7829c074049295b869db1bdcf4f457ebefea62b7 /lib/git/cmd.py | |
parent | a67bf61b5017e41740e997147dc88282b09c6f86 (diff) | |
download | gitpython-46c9a0df4403266a320059eaa66e7dce7b3d9ac4.tar.gz |
cmd: added clear_cache method now used by test repo decorators to be sure persistent commands are killed before trying to remove the directory. Unfortunately, it still claims someone has opened the file. handle.exe does not show anyone, so what is happening here ? Is it just a windows odity ? If nothing helps I could just keep the temp data, but lets do some more testing first
Diffstat (limited to 'lib/git/cmd.py')
-rw-r--r-- | lib/git/cmd.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/git/cmd.py b/lib/git/cmd.py index 97d6613d..6d712ca9 100644 --- a/lib/git/cmd.py +++ b/lib/git/cmd.py @@ -17,7 +17,7 @@ execute_kwargs = ('istream', 'with_keep_cwd', 'with_extended_output', 'output_stream' ) extra = {} -# NOTE: Execution through a shell appears to be slightly faster, but in fact +# NOTE: Execution through a shell on windows appears to be slightly faster, but in fact # I consider it a problem whenever complex strings are passed and *interpreted* # by the shell beforehand. This can cause great confusion and reduces compatability # between the OS which is why the shell should not be used ( unless it does not work @@ -401,3 +401,16 @@ class Git(object): cmd.stdout.read(1) # finishing newlines return (hexsha, typename, size, data) + + def clear_cache(self): + """ + Clear all kinds of internal caches to release resources. + + Currently persistent commands will be interrupted. + + Returns + self + """ + self.cat_file_all = None + self.cat_file_header = None + return self |