Bug 575675 - Downloading duplicated LFS object
Summary: Downloading duplicated LFS object
Status: NEW
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 5.13   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-27 14:32 EDT by Igor Azaarny CLA
Modified: 2021-08-28 14:35 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Azaarny CLA 2021-08-27 14:32:47 EDT
It is ok to add the same large file under a different name , commit and push. I.e. create a.psd copy it to b.psd add both. 

However following exception is throws when cloning or checkout branch with the duplicated item (not the name, but body) 

java.nio.file.FileAlreadyExistsException: c:\dev\tmp\pointer-22-2\.git\lfs\objects\99\06\9906384301282cf400ac6a4b69d889cf4594e46fc0188291a7a5b37202d762cc
	at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:87)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
	at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:235)
	at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:478)
	at java.base/java.nio.file.Files.newOutputStream(Files.java:224)
	at java.base/java.nio.file.Files.copy(Files.java:3144)
	at org.eclipse.jgit.lfs.SmudgeFilter.downloadLfsResource(SmudgeFilter.java:205)
Comment 1 Thomas Wolf CLA 2021-08-28 14:35:11 EDT
At least in a unit test I cannot reproduce this. Could you share the real Java code that exhibits this problem?