Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 347023

Summary: Skip-worktree causes exception
Product: [Technology] EGit Reporter: k.hirakawa88
Component: CoreAssignee: Project Inbox <egit.core-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: caniszczyk, matthias.sohn, sop
Version: 0.12   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description k.hirakawa88 CLA 2011-05-24 13:03:33 EDT
Build Identifier: 20110218-0911

If I do git update-index --skip-worktree foo.txt through the command line, and have the foo.txt open in egit, egit throws an exception: 

'Repository Change Scanner' has encountered a problem.  An error occurred while scanning for changes.  Scanning aborted.  Unknown index version (or corrupt index): 3


Reproducible: Always

Steps to Reproduce:
1.mkdir test.  cd test
2.git init
3.create foo.txt
4.git add .
5.git commit -m "init"
6.git update-index --skip-worktree foo.txt
7.Open test in egit
8.Exception thrown.
Comment 1 Matthias Sohn CLA 2011-10-09 08:57:48 EDT
This problem was most probably caused by the fact that Repository Change Scanner (RCS) was using the deprecated GitIndex implementation which had a number of limitations. This has been fixed recently [1] by teaching RCS to rely on DirCache instead.

I tested your example with the current nightly build of EGit 1.2 [2] and everything worked as expected. I think the only missing piece is EGit support to set/unset the skip-worktree flag from the UI. I filed bug 360353 to track this.

[1] http://egit.eclipse.org/r/#change,4218
[2] http://download.eclipse.org/egit/updates-nightly