X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=builtin%2Fshow-ref.c;h=45f0340c3ea004822477ed70fdd14e05dfcd9bb5;hb=8b8a53744f60274ef07e3a2a51995129c8d42f38;hp=17ada88dfb9543ba782b84507b451fabfec28e10;hpb=bd01c6de67715586f7527115bb4f74e7929b3b66;p=git.git diff --git a/builtin/show-ref.c b/builtin/show-ref.c index 17ada88df..45f0340c3 100644 --- a/builtin/show-ref.c +++ b/builtin/show-ref.c @@ -105,7 +105,7 @@ match: static int add_existing(const char *refname, const unsigned char *sha1, int flag, void *cbdata) { struct string_list *list = (struct string_list *)cbdata; - string_list_insert(refname, list); + string_list_insert(list, refname); return 0; } @@ -120,7 +120,7 @@ static int add_existing(const char *refname, const unsigned char *sha1, int flag */ static int exclude_existing(const char *match) { - static struct string_list existing_refs = { NULL, 0, 0, 0 }; + static struct string_list existing_refs = STRING_LIST_INIT_NODUP; char buf[1024]; int matchlen = match ? strlen(match) : 0; @@ -193,7 +193,8 @@ static const struct option show_ref_options[] = { "only show SHA1 hash using digits", PARSE_OPT_OPTARG, &hash_callback }, OPT__ABBREV(&abbrev), - OPT__QUIET(&quiet), + OPT__QUIET(&quiet, + "do not print results to stdout (useful with --verify)"), { OPTION_CALLBACK, 0, "exclude-existing", &exclude_existing_arg, "pattern", "show refs from stdin that aren't in local repository", PARSE_OPT_OPTARG | PARSE_OPT_NONEG, exclude_existing_callback },