Re: Bogus error: Untracked working tree file '....' would be overwritten by merge. Aborting
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Nov 16, 2010, 11:34 UTC
- Message-ID
- <AANLkTikeaj6kfq+pv+F0mOUSC7yJKnwyUgy9k8GPTpxg@mail.gmail.com>
- In-Reply-To
- <20101116112406.GA18259@do>
On Tue, Nov 16, 2010 at 6:24 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
> +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().
-- Duy