From: Duy Nguyen Date: Sat, 27 Feb 2016 08:28:22 GMT Subject: Re: [PATCH 1/2] submodule: port resolve_relative_url from shell to C Message-ID: <20160227082821.GA14856@lanh> In-Reply-To: <1455320356-15778-2-git-send-email-sbeller@google.com> On Fri, Feb 12, 2016 at 03:39:15PM -0800, Stefan Beller wrote: > Later on we want to automatically call `git submodule init` from > other commands, such that the users don't have to initialize the > submodule themselves. As these other commands are written in C > already, we'd need the init functionality in C, too. The > `resolve_relative_url` function is a large part of that init > functionality, so start by porting this function to C. > > To create the tests in t0060, the function `resolve_relative_url` > was temporarily enhanced to write all inputs and output to disk > when running the test suite. The added tests in this patch are > a small selection thereof. > > Signed-off-by: Stefan Beller > Signed-off-by: Junio C Hamano > --- > builtin/submodule--helper.c | 208 +++++++++++++++++++++++++++++++++++++++++++- i18n fixes. Can you squash this patch in when it's re-rolled? -- 8< -- diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index f4a0fd7..a6e54fa 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -22,7 +22,7 @@ static char *get_default_remote(void) const char *refname = resolve_ref_unsafe("HEAD", 0, sha1, &flag); if (!refname) - die("No such ref: HEAD"); + die(_("No such ref: %s"), "HEAD"); /* detached HEAD */ if (!strcmp(refname, "HEAD")) -- 8< --