Thread (6 messages) flat view 6 messages, 3 authors, 2016-06-15

Re: Bogus error: Untracked working tree file '....' would be overwritten by merge. Aborting

From: demerphq <hidden>
Date: 2016-06-15 22:50:03

On 16 November 2010 12:34, Nguyen Thai Ngoc Duy [off-list ref] wrote:
On Tue, Nov 16, 2010 at 6:24 PM, Nguyen Thai Ngoc Duy [off-list ref] wrote:
quoted
+static int identical_content(struct cache_entry *ce, struct stat *st)
+{
+       unsigned char sha1[20];
+       return !index_path(sha1, ce->name, st, 0) && !hashcmp(sha1, ce->sha1);
Even better, do a file size check here. If it's not equal, there's no
point in calling the expensive index_path().
I tried your patch, with the size check modification, and it seems to
work (meaning it passed all existing tests).

Ill try to put together tests and a proper patch soon.

Im hoping that if someone thinks that such a patch would be dismissed
out of hand that they will let me know....

cheers,
Yves


-- 
perl -Mre=debug -e "/just|another|perl|hacker/"
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help