git/builtin
Jeff King 114a6a889f refactor refs_from_alternate_cb to allow passing extra data
The foreach_alt_odb function triggers a callback for each
alternate object db we have, with room for a single void
pointer as data. Currently, we always call refs_from_alternate_cb
as the callback function, and then pass another callback (to
receive each ref individually) as the void pointer.

This has two problems:

  1. C technically forbids stuffing a function pointer into
     a "void *". In practice, this probably doesn't matter
     on any architectures git runs on, but it never hurts to
     follow the letter of the law.

  2. There is no room for an extra data pointer. Indeed, the
     alternate_ref_fn that refs_from_alternate_cb calls
     takes a void* for data, but we always pass it NULL.

Instead, let's properly stuff our function pointer into a
data struct, which also leaves room for an extra
caller-supplied data pointer. And to keep things simple for
existing callers, let's make a for_each_alternate_ref
function that takes care of creating the extra struct.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-19 20:01:10 -07:00
..
add.c Merge branch 'jc/fix-add-u-unmerged' into maint 2011-05-16 16:37:33 -07:00
annotate.c
apply.c Merge branch 'jc/maint-add-p-overlapping-hunks' into maint 2011-05-16 16:36:46 -07:00
archive.c
bisect--helper.c
blame.c blame: tolerate bogus e-mail addresses a bit better 2011-04-29 11:09:42 -07:00
branch.c Merge branch 'ab/i18n-st' 2011-04-01 17:55:55 -07:00
bundle.c
cat-file.c
check-attr.c
check-ref-format.c
checkout-index.c
checkout.c Merge branch 'ab/i18n-st' 2011-04-01 17:55:55 -07:00
clean.c
clone.c Merge branch 'nd/init-gitdir' 2011-04-01 17:57:37 -07:00
commit-tree.c
commit.c Merge branch 'jc/index-update-if-able' into maint 2011-04-03 12:33:05 -07:00
config.c Merge branch 'lp/config-vername-check' into maint 2011-04-03 12:29:45 -07:00
count-objects.c
describe.c Merge branch 'lt/default-abbrev' into maint 2011-04-03 12:32:51 -07:00
diff-files.c
diff-index.c
diff-tree.c
diff.c Merge branch 'jc/index-update-if-able' into maint 2011-04-03 12:33:05 -07:00
fast-export.c
fetch-pack.c refactor refs_from_alternate_cb to allow passing extra data 2011-05-19 20:01:10 -07:00
fetch.c Merge branch 'jl/submodule-fetch-on-demand' 2011-04-04 15:02:01 -07:00
fmt-merge-msg.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
for-each-ref.c
fsck.c Remove unused variables 2011-03-22 11:43:27 -07:00
gc.c
grep.c sparse: Fix errors and silence warnings 2011-04-03 10:14:53 -07:00
hash-object.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
help.c
index-pack.c sparse: Fix errors and silence warnings 2011-04-03 10:14:53 -07:00
init-db.c Merge branch 'nd/init-gitdir' 2011-04-01 17:57:37 -07:00
log.c Merge branch 'cn/format-patch-quiet' into maint 2011-05-15 16:10:49 -07:00
ls-files.c
ls-remote.c
ls-tree.c
mailinfo.c
mailsplit.c
merge-base.c Documentation: update to git-merge-base --octopus 2011-04-15 10:13:52 -07:00
merge-file.c
merge-index.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
merge-ours.c
merge-recursive.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
merge-tree.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
merge.c Merge branch 'jc/maint-branch-mergeoptions' into maint 2011-05-16 16:37:07 -07:00
mktag.c Merge branch 'jn/maint-c99-format' 2011-03-23 14:55:46 -07:00
mktree.c
mv.c
name-rev.c
notes.c Merge branch 'ab/i18n-st' 2011-04-01 17:55:55 -07:00
pack-objects.c Teach core.bigfilethreashold to pack-objects 2011-04-05 20:25:49 -07:00
pack-redundant.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
pack-refs.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
patch-id.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
prune-packed.c
prune.c
push.c Merge branch 'ab/i18n-st' 2011-04-01 17:55:55 -07:00
read-tree.c
receive-pack.c refactor refs_from_alternate_cb to allow passing extra data 2011-05-19 20:01:10 -07:00
reflog.c
remote-ext.c Remove unused variables 2011-03-22 11:43:27 -07:00
remote-fd.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
remote.c Merge branch 'jk/maint-remote-mirror-safer' 2011-04-06 10:38:14 -07:00
replace.c
rerere.c
reset.c Merge branch 'ab/i18n-st' 2011-04-01 17:55:55 -07:00
rev-list.c revision.c: introduce --min-parents and --max-parents options 2011-03-23 10:16:44 -07:00
rev-parse.c revision.c: introduce --min-parents and --max-parents options 2011-03-23 10:16:44 -07:00
revert.c revert: Hide '-r' option in default usage 2011-04-13 11:02:49 -07:00
rm.c
send-pack.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
shortlog.c i18n: git-shortlog basic messages 2011-03-09 23:52:58 -08:00
show-branch.c
show-ref.c
stripspace.c
symbolic-ref.c
tag.c Merge branch 'ab/i18n-st' 2011-04-01 17:55:55 -07:00
tar-tree.c
unpack-file.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
unpack-objects.c
update-index.c
update-ref.c
update-server-info.c
upload-archive.c
var.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
verify-pack.c
verify-tag.c
write-tree.c