diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-03-10 13:24:24 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-10 13:24:24 -0800 |
commit | ae900ebd71b58c12356674228ce99e6673da3dec (patch) | |
tree | 5485ca879bc50db5bce344d9a715bb678a563906 /builtin | |
parent | Merge branch 'rj/remove-unused-mktemp' (diff) | |
parent | submodule init: warn about falling back to a local path (diff) | |
download | tgif-ae900ebd71b58c12356674228ce99e6673da3dec.tar.xz |
Merge branch 'sb/submodule-init-url-selection'
When "git submodule init" decides that the submodule in the working
tree is its upstream, it now gives a warning as it is not a very
common setup.
* sb/submodule-init-url-selection:
submodule init: warn about falling back to a local path
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/submodule--helper.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index 899dc334e3..15a5430c00 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -356,12 +356,10 @@ static void init_submodule(const char *path, const char *prefix, int quiet) strbuf_addf(&remotesb, "remote.%s.url", remote); free(remote); - if (git_config_get_string(remotesb.buf, &remoteurl)) - /* - * The repository is its own - * authoritative upstream - */ + if (git_config_get_string(remotesb.buf, &remoteurl)) { + warning(_("could not lookup configuration '%s'. Assuming this repository is its own authoritative upstream."), remotesb.buf); remoteurl = xgetcwd(); + } relurl = relative_url(remoteurl, url, NULL); strbuf_release(&remotesb); free(remoteurl); |