Re: [PATCH] get_tree_entry: map blank requested entry to tree root

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 09, 2007 at 03:48:33PM -0800, Junio C Hamano wrote:

> Makes sense, although I somewhat worry about changing the
> behaviour and potentially breaking the expectation of callers
> of get_tree_entry() other than "git show".

Previously, trying to get an empty name would always return -1. Most of
the users besides sha1_name are getting the paths by enumerating the
index or an existing tree, so they will never be blank. The exceptions
are:
 - git-blame ''; this fails in both the root and a subdir (though with
   different errors); behavior is unchanged with my patch
 - git-archive feeds the 'prefix' variable to get_tree_entry; it works
   fine in the root with or without the patch. I seem to be getting an
   error, with or without my patch, when doing a git-archive from a
   subdirectory:
     $ git-archive --format=tar origin >/dev/null
     $ cd Documentation
     $ git-archive --format=tar origin >/dev/null
     fatal: cannot read c87c61af00c6d2cd7212240e260809000000aaab
   but I haven't been able to track it down further. It's clearly
   unrelated to my patch, though.

The main difference is that looking up a ref through sha1_name used to
fail to match 'HEAD:'; now it does. So if you were trying to match a
file 'HEAD:' without using '--', you're out of luck.

-Peff
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]