diff options
author | Christian Halstrick <christian.halstrick@sap.com> | 2016-05-18 15:03:51 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2016-05-23 15:39:04 +0200 |
commit | ffa237e7dbd56df2f28d45113fe0ea03337900f1 (patch) | |
tree | 04afc8c0231486d5d0ab4d0ab92ed44a20b165d1 /org.eclipse.jgit.http.server | |
parent | 4641c43a98dd291403fa776cf7ff6d5e5f5b2031 (diff) | |
download | jgit-ffa237e7dbd56df2f28d45113fe0ea03337900f1.tar.gz jgit-ffa237e7dbd56df2f28d45113fe0ea03337900f1.zip |
Fix computation of id in WorkingTreeIterator with autocrlf and smudging
JGit failed to do checkouts when the index contained smudged entries and
autocrlf was on. In such cases the WorkingTreeIterator calculated the
SHA1 sometimes on content which was not correctly filtered. The SHA1 was
computed on content which two times went through a lf->crlf conversion.
We used to tell the treewalk whether it is a checkin or checkout
operation and always use the related filters when reading any content.
If on windows and autocrlf is true and we do a checkout operation then
we always used a lf->crlf conversion on any text content. That's not
correct. Even during a checkout we sometimes need the crlf->lf
conversion. E.g. when calculating the content-id for working-tree
content we need to use crlf->lf filtering although the overall operation
type is checkout.
Often this bug does not have effects because we seldom compute the
content-id of filesystem content during a checkout. But we do need to
know whether a file is dirty or not before we overwrite it during a
checkout. And if the index entries are smudged we don't trust the index
and compute filesystem-content-sha1's explicitly.
This caused EGit not to be able to switch branches anymore on Windows
when autocrlf was true. EGit denied the checkout because it thought
workingtree files are dirty because content-sha1 are computed on wrongly
filtered content.
Bug: 493360
Change-Id: I1072a57b4c529ba3aaa50b7b02d2b816bb64a9b8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.http.server')
0 files changed, 0 insertions, 0 deletions