Re: [PATCH] Implement git remote mv
- From
Brandon Casey <casey@nrlssc.navy.mil>
- Date
- Oct 22, 2008, 16:52 UTC
- Message-ID
- <JQScKsOjmj-C7kmMPApAxZ3UDmaTZ1j0HkObQuCveJ9n4G-4o6Zxbw@cipher.nrlssc.navy.mil>
- In-Reply-To
- <1224634994-1664-1-git-send-email-vmiklos@frugalware.org>
Miklos Vajna wrote:
Show 9 quoted lines
> +static int mv(int argc, const char **argv)
> +{
> + struct option options[] = {
> + OPT_END()
> + };
> + struct remote *oldremote, *newremote;
> + struct strbuf buf = STRBUF_INIT, buf2 = STRBUF_INIT;
> + struct string_list remote_branches = { NULL, 0, 0, 0 };
> + struct rename_info rename = { argv[1], argv[2], &remote_branches };I think some non-c99 compilers would have issues with this run-time initialization from function arguments. Plus, what if argv doesn't have 3 elements? I see you have a check for that below...
> + int i; > + > + if (argc != 3) > + usage_with_options(builtin_remote_usage, options);
-brandon