一部のファイルが期待どおりに追跡されない状態でインデックスを取得することができました。
例として、作業ディレクトリに変更されていない size.h と test.h があります。
$ git-ls-files -st size.h test.h
H 100644 de2c741b07d86f92bdd660626848072cb2bf510f 0 size.h
H 100644 8bb24bc7483ffcfc0fc1a3761dc63e86a1b3e003 0 test.h
$ git status
# On branch master
nothing to commit (working directory clean)
次に、両方のファイルにランダムな変更を加えます。
$ fortune >> size.h
$ fortune >> test.h
何らかの理由で size.h は変更されていません (ただし、ファイルは明らかに変更されています)。同時に、test.h が期待どおりに変更されます。
$ git status
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: test.h
#
no changes added to commit (use "git add" and/or "git commit -a")
インデックスを削除してリセットすると、すべてが正常に戻ります。
$ rm .git/index
$ git reset
Unstaged changes after reset:
M size.h
M test.h
$ git status
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: size.h
# modified: test.h
#
no changes added to commit (use "git add" and/or "git commit -a")
奇妙さが現れる前に、このリポジトリの samba を介して、CentOS で git 1.6.6 と Windows で msysgit 1.6.5.1 を使用していました。これを新しいクローンから再現することはできませんでした。
私の直感では、これは msysgit のバグであり、おそらく Samba との組み合わせによるものです。何か案は?