From: Junio C Hamano Date: Fri, 6 Jun 2008 16:21:48 +0000 (-0700) Subject: Merge branch 'maint' X-Git-Tag: v1.5.6-rc2~8 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/e919cb302e75141c2565106bed2f0b6cb8047570?ds=inline;hp=-c Merge branch 'maint' * maint: git-for-each-ref.txt: minor improvements name-rev: Fix segmentation fault when using --all --- e919cb302e75141c2565106bed2f0b6cb8047570 diff --combined builtin-name-rev.c index cde5de56fa,521f061c9e..f153da012f --- a/builtin-name-rev.c +++ b/builtin-name-rev.c @@@ -195,7 -195,7 +195,7 @@@ int cmd_name_rev(int argc, const char * OPT_END(), }; - git_config(git_default_config); + git_config(git_default_config, NULL); argc = parse_options(argc, argv, opts, name_rev_usage, 0); if (!!all + !!transform_stdin + !!argc > 1) { error("Specify either a list, or --all, not both!"); @@@ -280,9 -280,13 +280,13 @@@ int i, max; max = get_max_object_index(); - for (i = 0; i < max; i++) - show_name(get_indexed_object(i), NULL, + for (i = 0; i < max; i++) { + struct object *obj = get_indexed_object(i); + if (!obj) + continue; + show_name(obj, NULL, always, allow_undefined, data.name_only); + } } else { int i; for (i = 0; i < revs.nr; i++)