git/builtin
Junio C Hamano c19387e799 name-hash: allow hashing an empty string
Usually we do not pass an empty string to the function hash_name()
because we almost always ask for hash values for a path that is a
candidate to be added to the index. However, check-ignore (and most
likely check-attr, but I didn't check) apparently has a callchain
to ask the hash value for an empty path when it was given a "." from
the top-level directory to ask "Is the path . excluded by default?"

Make sure that hash_name() does not overrun the end of the given
pathname even when it is empty.

Remove a sweep-the-issue-under-the-rug conditional in check-ignore
that avoided to pass an empty string to the callchain while at it.
It is a valid question to ask for check-ignore if the top-level is
set to be ignored by default, even though the answer is most likely
no, if only because there is currently no way to specify such an
entry in the .gitignore file. But it is an unusual thing to ask and
it is not worth optimizing for it by special casing at the top level
of the call chain.

Signed-off-by: Adam Spiers <git@adamspiers.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-19 14:00:12 -08:00
..
add.c add.c: extract new die_if_path_beyond_symlink() for reuse 2013-01-06 14:26:37 -08:00
annotate.c
apply.c Merge branch 'jc/apply-binary-p0' into maint-1.7.11 2012-09-12 14:00:53 -07:00
archive.c
bisect--helper.c
blame.c Merge branch 'tr/void-diff-setup-done' into maint-1.7.11 2012-09-11 10:53:40 -07:00
branch.c branch: remove lego in i18n tracking info strings 2012-05-04 09:12:24 -07:00
bundle.c
cat-file.c Merge branch 'jk/maint-null-in-trees' into maint-1.7.11 2012-09-10 15:24:54 -07:00
check-attr.c
check-ignore.c name-hash: allow hashing an empty string 2013-02-19 14:00:12 -08:00
check-ref-format.c
checkout-index.c
checkout.c Merge branch 'tr/void-diff-setup-done' into maint-1.7.11 2012-09-11 10:53:40 -07:00
clean.c clean.c, ls-files.c: respect encapsulation of exclude_list_groups 2013-01-16 09:43:35 -08:00
clone.c Merge branch 'ar/clone-honor-umask-at-top' into maint 2012-07-22 13:04:05 -07:00
column.c Add column layout skeleton and git-column 2012-04-27 09:26:37 -07:00
commit-tree.c Merge branch 'kk/maint-1.7.9-commit-tree' into kk/maint-commit-tree 2012-07-17 13:10:49 -07:00
commit.c split_ident_line(): make best effort when parsing author/committer line 2012-08-31 14:54:18 -07:00
config.c config: "git config baa" should exit with status 1 2012-07-30 08:51:26 -07:00
count-objects.c
describe.c
diff-files.c
diff-index.c
diff-tree.c
diff.c Merge branch 'tr/void-diff-setup-done' into maint-1.7.11 2012-09-11 10:53:40 -07:00
fast-export.c Merge branch 'js/fast-export-paths-with-spaces' into maint 2012-07-22 13:00:45 -07:00
fetch-pack.c Merge branch 'jk/fetch-pack-remove-dups-optim' 2012-05-29 13:09:08 -07:00
fetch.c Merge branch 'mb/fetch-call-a-non-branch-a-ref' into maint 2012-05-03 15:29:25 -07:00
fmt-merge-msg.c Merge branch 'jc/fmt-merge-msg-people' 2012-06-12 08:33:30 -07:00
for-each-ref.c for-each-ref: Fix sort with multiple keys 2012-08-21 14:42:12 -07:00
fsck.c fsck: use streaming API for writing lost-found blobs 2012-03-07 09:07:39 -08:00
gc.c gc: use argv-array for sub-commands 2012-04-18 16:17:42 -07:00
grep.c Merge branch 'mm/verify-filename-fix' into maint 2012-07-11 12:45:49 -07:00
hash-object.c
help.c Merge branch 'nd/columns' 2012-05-03 15:13:31 -07:00
index-pack.c index-pack: Disable threading on cygwin 2012-06-26 14:23:03 -07:00
init-db.c
log.c log: fix --quiet synonym for -s 2012-08-28 15:37:29 -07:00
ls-files.c clean.c, ls-files.c: respect encapsulation of exclude_list_groups 2013-01-16 09:43:35 -08:00
ls-remote.c
ls-tree.c
mailinfo.c mailinfo: with -b, keep space after [foo] 2012-01-16 16:06:57 -08:00
mailsplit.c
merge-base.c
merge-file.c remove superfluous newlines in error messages 2012-04-30 15:45:51 -07:00
merge-index.c
merge-ours.c
merge-recursive.c
merge-tree.c
merge.c Merge branch 'tr/void-diff-setup-done' into maint-1.7.11 2012-09-11 10:53:40 -07:00
mktag.c
mktree.c
mv.c Merge branch 'jk/maint-mv' into maint 2011-12-28 11:32:36 -08:00
name-rev.c
notes.c
pack-objects.c pack-objects: refactor write_object() into helper functions 2012-05-18 14:22:15 -07:00
pack-redundant.c
pack-refs.c
patch-id.c
prune-packed.c fix deletion of .git/objects sub-directories in git-prune/repack 2012-03-07 10:24:33 -08:00
prune.c fix deletion of .git/objects sub-directories in git-prune/repack 2012-03-07 10:24:33 -08:00
push.c Merge branch 'ct/advise-push-default' into maint 2012-05-11 11:18:43 -07:00
read-tree.c
receive-pack.c receive-pack: do not leak output from auto-gc to standard output 2012-08-06 22:31:10 -07:00
reflog.c
remote-ext.c
remote-fd.c
remote.c remote: fix typo 2012-05-20 18:48:10 -07:00
replace.c
rerere.c
reset.c verify_filename(): ask the caller to chose the kind of diagnosis 2012-06-18 15:21:42 -07:00
rev-list.c Merge branch 'jk/maint-reflog-walk-count-vs-time' into maint 2012-05-14 11:46:16 -07:00
rev-parse.c specifying ranges: we did not mean to make ".." an empty set 2012-08-23 14:37:49 -07:00
revert.c Merge branch 'cc/fix-missing-va-end-in-revert' into maint 2012-05-10 10:32:43 -07:00
rm.c
send-pack.c teach send-pack about --[no-]progress 2012-05-01 09:40:30 -07:00
shortlog.c
show-branch.c
show-ref.c
stripspace.c
symbolic-ref.c symbolic-ref --short: abbreviate the output unambiguously 2012-02-27 15:58:36 -08:00
tag.c ident: rename IDENT_ERROR_ON_NO_NAME to IDENT_STRICT 2012-05-24 17:16:41 -07:00
tar-tree.c
unpack-file.c
unpack-objects.c remove superfluous newlines in error messages 2012-04-30 15:45:51 -07:00
update-index.c Merge branch 'hv/submodule-update-nuke-submodules' into maint 2012-07-11 12:46:31 -07:00
update-ref.c
update-server-info.c update-server-info: respect core.bigfilethreshold 2012-03-07 09:07:39 -08:00
upload-archive.c
var.c ident: rename IDENT_ERROR_ON_NO_NAME to IDENT_STRICT 2012-05-24 17:16:41 -07:00
verify-pack.c
verify-tag.c verify-tag: Parse GPG configuration options. 2012-03-08 14:03:07 -08:00
write-tree.c