diff options
author | Christian Halstrick <christian.halstrick@sap.com> | 2013-03-15 11:08:17 +0100 |
---|---|---|
committer | Christian Halstrick <christian.halstrick@sap.com> | 2013-03-19 14:28:24 +0100 |
commit | bd5e4eabc2a949dbce4d968d338106d46ff223df (patch) | |
tree | d006d568d9aef59219fd27d4706674f74493d320 /org.eclipse.jgit.ui | |
parent | 67b98d5d40d3d531c2383bbc13d7d93abc7d1b8e (diff) | |
download | jgit-bd5e4eabc2a949dbce4d968d338106d46ff223df.tar.gz jgit-bd5e4eabc2a949dbce4d968d338106d46ff223df.zip |
Fix GC for FileRepo in case packfile renames fail
Only on Windows the rename operation which renames temporary Packfiles
(and index-files and bitmap-files) sometime fails. This happens only
when renaming a temporary Packfile to a Packfile which already exists.
Such situations occur if you run GC twice on a repo without modifying
the repo inbetween.
In such situations there was bug in GC which led to a corrupted repo
whithout any packfiles anymore. This commit fixes the problem by
introducing a utility method which renames a file and throws an
IOException if it fails. This method also takes care to repeat a
failing rename if our FS class has found out we are running on a
platform with a unreliable File.renameTo() method.
I am searching for a better solution because even with this utility
method in hand a GC on a already GC'ed repo will fail on Windows. But
at least with this fix we will not produce corrupted repos anymore.
Bug: 389305
Change-Id: Iac1ab3e0b8c419c90404f2e2f3559672eb8f6d28
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.ui')
0 files changed, 0 insertions, 0 deletions