This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 224551

Summary: Git: FileNotFoundException when adding/commiting a symlink
Product: versioncontrol Reporter: pekarna <pekarna>
Component: GitAssignee: Ondrej Vrabec <ovrabec>
Status: RESOLVED FIXED    
Severity: normal CC: git
Priority: P4    
Version: 7.2.1   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description pekarna 2013-01-07 03:46:52 UTC
I've created a symlink in my repo (which leads to non-existent file intentionally).
When trying to commit it, I get this dialog:

Git Command Failed
==================
java.io.FileNotFoundException: /home/ondra/uw/agreco.cz/git-os/php/fotky_ (No such file or directory)

Adding a symlink is supported in Git.
I was able to add it using git in shell.
Comment 1 Ondrej Vrabec 2013-01-07 12:51:24 UTC
adding a file to index fails, commit is fine:
INFO [org.netbeans.modules.git]: java.io.FileNotFoundException: /home/ondra/NetBeansProjects/git/212986/2/212986/bbb (No such file or directory)
java.io.FileNotFoundException: /home/ondra/NetBeansProjects/git/212986/2/212986/bbb (No such file or directory)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at org.eclipse.jgit.treewalk.FileTreeIterator$FileEntry.openInputStream(FileTreeIterator.java:198)
        at org.eclipse.jgit.treewalk.WorkingTreeIterator.openEntryStream(WorkingTreeIterator.java:500)
        at org.netbeans.libs.git.jgit.commands.AddCommand.run(AddCommand.java:143)
Caused: org.netbeans.libs.git.GitException
        at org.netbeans.libs.git.jgit.commands.AddCommand.run(AddCommand.java:182)
        at org.netbeans.libs.git.jgit.commands.GitCommand.execute(GitCommand.java:73)
        at org.netbeans.libs.git.GitClient.add(GitClient.java:221)
Comment 2 Ondrej Vrabec 2013-01-07 14:09:24 UTC
No sure how to fix this reliably, JGit does not fully support symlinks and i am afraid without a change in JGit's code i cannot fix it. Maybe using reflection and methods from JDK7?
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=354367
Comment 3 Ondrej Vrabec 2013-07-30 13:56:19 UTC
hopefully fixing with JDK7 java.nio

fix: http://hg.netbeans.org/core-main/rev/62e8b8af8ee5
Comment 4 Quality Engineering 2013-08-01 02:32:05 UTC
Integrated into 'main-silver', will be available in build *201307312300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/62e8b8af8ee5
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #224551 - Git: FileNotFoundException when adding/commiting a symlink