|
|
@ -1757,7 +1757,8 @@ static int reuse_worktree_file(const char *name, const unsigned char *sha1, int |
|
|
|
struct stat st; |
|
|
|
struct stat st; |
|
|
|
int pos, len; |
|
|
|
int pos, len; |
|
|
|
|
|
|
|
|
|
|
|
/* We do not read the cache ourselves here, because the |
|
|
|
/* |
|
|
|
|
|
|
|
* We do not read the cache ourselves here, because the |
|
|
|
* benchmark with my previous version that always reads cache |
|
|
|
* benchmark with my previous version that always reads cache |
|
|
|
* shows that it makes things worse for diff-tree comparing |
|
|
|
* shows that it makes things worse for diff-tree comparing |
|
|
|
* two linux-2.6 kernel trees in an already checked out work |
|
|
|
* two linux-2.6 kernel trees in an already checked out work |
|
|
@ -1797,6 +1798,13 @@ static int reuse_worktree_file(const char *name, const unsigned char *sha1, int |
|
|
|
if (hashcmp(sha1, ce->sha1) || !S_ISREG(ce->ce_mode)) |
|
|
|
if (hashcmp(sha1, ce->sha1) || !S_ISREG(ce->ce_mode)) |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
* If ce is marked as "assume unchanged", there is no |
|
|
|
|
|
|
|
* guarantee that work tree matches what we are looking for. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
if (ce->ce_flags & CE_VALID) |
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
/* |
|
|
|
* If ce matches the file in the work tree, we can reuse it. |
|
|
|
* If ce matches the file in the work tree, we can reuse it. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|