Re: [PATCH 1/3] git remote update: Report error for non-existing groups
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 8, 2009, 02:16 UTC
- Message-ID
- <7vprfnubyi.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <1239025262-16960-2-git-send-email-finnag@pvv.org>
Finn Arne Gangstad <finnag@pvv.org> writes:
Show 10 quoted lines
> @@ -1227,8 +1229,11 @@ static int update(int argc, const char **argv)
>
> remote_group.list = &list;
> for (i = 1; i < argc; i++) {
> + int groups_found = 0;
> remote_group.name = argv[i];
> - result = git_config(get_remote_group, NULL);
> + result = git_config(get_remote_group, &groups_found);
> + if (!groups_found && (i != 1 || strcmp(argv[1], "default")))
> + die("No such remote group: '%s'", argv[i]);I think you are trying to be silent about the case where the caller feeds you the default_argv[] array with this, but do we want to be more explicit about this so that we do die when the end user explicitly says "default" from the command line?