Git development
 help / color / mirror / Atom feed
From: Petr Baudis <pasky@ucw.cz>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: git@vger.kernel.org, junkio@cox.net
Subject: Broken adding of cache entries
Date: Sat, 7 May 2005 17:28:50 +0200	[thread overview]
Message-ID: <20050507152849.GD9495@pasky.ji.cz> (raw)
In-Reply-To: <1115431767.32065.182.camel@localhost.localdomain>

Dear diary, on Sat, May 07, 2005 at 04:09:27AM CEST, I got a letter
where Kay Sievers <kay.sievers@vrfy.org> told me that...
..snip..
> Look what funny thing you can do:
>   kay@mam:~/public_html/pub/scm/funny-tree$ git-ls-tree HEAD
>   100644  blob    b1a17ba136936531b72571844a773fe938b85ad4        entry
>   040000  tree    eba6ba02f18176500019755ad58c0bdfead16c47        entry
> 
> Add a file to the cache, replace it with a directory, add that to the
> cache and then write the tree and you have two entries with the same
> name. :)

Duh. Well, what could be the reasonwhy cache_name_compare() cares about
flags at all? Can you _ever_ have two same-named entries? Junio, what do
you think about something like this?

Index: read-cache.c
===================================================================
--- e47e2a558a85b33e0652233f78aa1ca8a959685b/read-cache.c  (mode:100644)
+++ uncommitted/read-cache.c  (mode:100644)
@@ -68,10 +68,6 @@
 		return -1;
 	if (len1 > len2)
 		return 1;
-	if (flags1 < flags2)
-		return -1;
-	if (flags1 > flags2)
-		return 1;
 	return 0;
 }
 


-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor

       reply	other threads:[~2005-05-07 15:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1115408460.32065.37.camel@localhost.localdomain>
     [not found] ` <20050506231447.GG32629@pasky.ji.cz>
     [not found]   ` <1115421933.32065.111.camel@localhost.localdomain>
     [not found]     ` <20050506233003.GJ32629@pasky.ji.cz>
     [not found]       ` <1115423450.32065.138.camel@localhost.localdomain>
     [not found]         ` <20050507001409.GP32629@pasky.ji.cz>
     [not found]           ` <1115431767.32065.182.camel@localhost.localdomain>
2005-05-07 15:28             ` Petr Baudis [this message]
2005-05-07 18:42               ` Broken adding of cache entries Junio C Hamano
2005-05-07 19:22               ` Junio C Hamano
2005-05-07 22:41                 ` Petr Baudis
2005-05-08  0:43                   ` Junio C Hamano
2005-05-08  1:50                     ` Junio C Hamano
2005-05-08  5:22                       ` Junio C Hamano
2005-05-08 16:59                         ` Petr Baudis
2005-05-08 21:06                           ` Junio C Hamano
2005-05-08 21:22                             ` Petr Baudis
2005-05-08 22:18                               ` Junio C Hamano
2005-05-08 22:22                                 ` Junio C Hamano
2005-05-08 22:42                                   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050507152849.GD9495@pasky.ji.cz \
    --to=pasky@ucw.cz \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=kay.sievers@vrfy.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox