git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Nov 17, 2010, 08:46 UTC
Message-ID
<vpqtyjgxrqk.fsf@bauges.imag.fr>
In-Reply-To
<AANLkTikeaj6kfq+pv+F0mOUSC7yJKnwyUgy9k8GPTpxg@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
Show 5 quoted lines
> 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);
I do like the idea.
> Even better, do a file size check here. If it's not equal, there's no
> point in calling the expensive index_path().
I think you also need to check mode changes here.
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Ævar Arnfjörð BjarmasonNext: Nguyen Thai Ngoc Duy
Message 7 of 8 in “Bogus error: Untracked working tree file '....' would be overwritten by merge. Aborting”
  1. demerphqNov 16, 2010
  2. demerphqNov 16, 2010
  3. Nguyen Thai Ngoc DuyNov 16, 2010
  4. Nguyen Thai Ngoc DuyNov 16, 2010
  5. demerphqNov 17, 2010
  6. Ævar Arnfjörð BjarmasonNov 17, 2010
  7. Matthieu MoyNov 17, 2010
  8. Nguyen Thai Ngoc DuyNov 17, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.