git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mktree: multiple same-named objects
@ 2014-08-27  4:41 David Turner
  2014-08-27  5:01 ` Duy Nguyen
  2014-08-27  5:13 ` Jeff King
  0 siblings, 2 replies; 6+ messages in thread
From: David Turner @ 2014-08-27  4:41 UTC (permalink / raw)
  To: git mailing list

git mktree seems to allow the creation of a tree object with multiple
objects of the same name but different SHAs.  This leads to weird
behavior later, unsurprisingly.  For instance, if there are two tree
objects with the same name but different SHAs, the checked out tree will
be the union of them (reasonably), but if you do git add $name, some or
all unmodified files under $name will show up in git status as modified
-- since they differ from one of the parent trees, presumably.

And if different git implementations treat this case differently, then
it might be possible to make a repo that appears to contain one thing
when viewed with one implementation, but contains a different thing for
a different implementation.

Summary: git mktree ought to forbid this, and possibly there ought to be
other checks (for instance, when unpacking) to prevent this.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-08-27 21:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-27  4:41 mktree: multiple same-named objects David Turner
2014-08-27  5:01 ` Duy Nguyen
2014-08-27 21:48   ` David Turner
2014-08-27  5:13 ` Jeff King
2014-08-27 15:17   ` Junio C Hamano
2014-08-27 16:24     ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).