[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [jgit-dev] JGit checkout of multiple tags fails with "Could not rename file"
- From: Alex Blewitt <alex.blewitt@xxxxxxxxx>
- Date: Fri, 19 Sep 2014 19:54:24 +0100
- Delivered-to: email@example.com
It's most likely not the pack files but a leftover file reference you have on the extracted contents. When windows has a process that opens a file it will lock it and prevent renaming/deleting/changing. Only when the file is closed can you rename it.
This doesn't occur on other operating systems though so you won't see it.
I would expect something is holding open your pom. If you're doing it in an eclipse workspace it may be eclipse itself that is noticing the file and opening it for reading.
Sent from my iPhone 5
> On 19 Sep 2014, at 15:57, "Andrey Loskutov" <loskutov@xxxxxx> wrote:
> I've observed not the same but similar issue during tests on Linux NFS mount, where jgit was not (always) cleaning up the opened temporary pack file streams, see  for more details.
> I didn't found the root cause however. I suspect that if you would add some delay between two checkout calls your issue would disappear, because this was what I've observed in debugger.
>  https://git.eclipse.org/r/#/c/30328/
> Kind regards,
> Andrey Loskutov
>> Gesendet: Freitag, 19. September 2014 um 16:39 Uhr
>> Von: "Sascha Vogt" <sascha.vogt@xxxxxxxxx>
>> An: jgit-dev@xxxxxxxxxxx
>> Betreff: [jgit-dev] JGit checkout of multiple tags fails with "Could not rename file"
>> Hi all,
>> since a few days I'm banging my head against a (JGit) wall ;) Maybe
>> somebody here understands my issue.
>> I'm trying to checkout a few tags one after another (to archive some
>> source code), but switching from one tag to another gives a strange
>> "Could not rename file" JGitInternalException.
>> Basically what I want to do (in cmd line commands):
>> 1. git clone <url>
>> 2. git checkout -b <tag-1> <tag-1>
>> 3. git checkout -b <tag-2> <tag-2>
>> On cmd line this works, in JGit I'm using the following commands:
>> The error I'm getting (full stack at the end of the mail):
>> org.eclipse.jgit.api.errors.JGitInternalException: Could not rename file
>> to D:\dev\tmp\unit-test\git\base\common\locator\pom.xml
>> Strange thing: It doesn't fail always, but around 90-95% of the time.
>> Also I'm on Windows as the path above suggests ;) TortoiseGit is
>> installed but I have disabled the TGitCache process. Also no explorer
>> was open on the used directory.
>> I also did git status commands in between checkouts -> no changed files.
>> I did also insert a git.clean().setCleanDirectories(true).call() and
>> git.reset().setRef("HEAD").setMode(ResetType.HARD).call() between
>> checkouts, no differences.
>> I tried JGit 2.3.1, 3.2, 3.4.1 and 3.5.0-rc1, also no differences.
>> When I check the state after such a failed checkout of tag-2 I'm seeing:
>> "git status":
>> HEAD detached at ef1edf8
>> nothing to commit, working directory clean
>> "git branch" gives:
>> * (detached from ef1edf8)
>> Has anybody any idea? I've no idea where to search next.
> jgit-dev mailing list
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit