Merge branch 'sb/submodule-path-misc-bugs' into sb/submodule-init
"git submodule" reports the paths of submodules the command recurses into, but this was incorrect when the command was not run from the root level of the superproject. Any further comments? Otherwise will merge to 'next'. * sb/submodule-path-misc-bugs: (600 commits) t7407: make expectation as clear as possible submodule update: test recursive path reporting from subdirectory submodule update: align reporting path for custom command execution submodule status: correct path handling in recursive submodules submodule update --init: correct path handling in recursive submodules submodule foreach: correct path display in recursive submodules Git 2.8 Documentation: fix git-p4 AsciiDoc formatting mingw: skip some tests in t9115 due to file name issues t1300: fix the new --show-origin tests on Windows t1300-repo-config: make it resilient to being run via 'sh -x' config --show-origin: report paths with forward slashes submodule: fix regression for deinit without submodules l10n: pt_PT: Update and add new translations l10n: ca.po: update translation Git 2.8-rc4 Documentation: fix broken linkgit to git-config Documentation: use ASCII quotation marks in git-p4 Revert "config.mak.uname: use clang for Mac OS X 10.6" git-compat-util: st_add4: work around gcc 4.2.x compiler crash ...
This commit is contained in:
@ -47,6 +47,7 @@ static const char *real_git_dir;
|
||||
static char *option_upload_pack = "git-upload-pack";
|
||||
static int option_verbosity;
|
||||
static int option_progress = -1;
|
||||
static enum transport_family family;
|
||||
static struct string_list option_config;
|
||||
static struct string_list option_reference;
|
||||
static int option_dissociate;
|
||||
@ -95,6 +96,10 @@ static struct option builtin_clone_options[] = {
|
||||
N_("separate git dir from working tree")),
|
||||
OPT_STRING_LIST('c', "config", &option_config, N_("key=value"),
|
||||
N_("set config inside the new repository")),
|
||||
OPT_SET_INT('4', "ipv4", &family, N_("use IPv4 addresses only"),
|
||||
TRANSPORT_FAMILY_IPV4),
|
||||
OPT_SET_INT('6', "ipv6", &family, N_("use IPv6 addresses only"),
|
||||
TRANSPORT_FAMILY_IPV6),
|
||||
OPT_END()
|
||||
};
|
||||
|
||||
@ -230,8 +235,8 @@ static char *guess_dir_name(const char *repo, int is_bundle, int is_bare)
|
||||
strip_suffix_mem(start, &len, is_bundle ? ".bundle" : ".git");
|
||||
|
||||
if (!len || (len == 1 && *start == '/'))
|
||||
die("No directory name could be guessed.\n"
|
||||
"Please specify a directory on the command line");
|
||||
die(_("No directory name could be guessed.\n"
|
||||
"Please specify a directory on the command line"));
|
||||
|
||||
if (is_bare)
|
||||
dir = xstrfmt("%.*s.git", (int)len, start);
|
||||
@ -338,7 +343,7 @@ static void copy_alternates(struct strbuf *src, struct strbuf *dst,
|
||||
FILE *in = fopen(src->buf, "r");
|
||||
struct strbuf line = STRBUF_INIT;
|
||||
|
||||
while (strbuf_getline(&line, in, '\n') != EOF) {
|
||||
while (strbuf_getline(&line, in) != EOF) {
|
||||
char *abs_path;
|
||||
if (!line.len || line.buf[0] == '#')
|
||||
continue;
|
||||
@ -635,9 +640,11 @@ static void update_remote_refs(const struct ref *refs,
|
||||
struct strbuf head_ref = STRBUF_INIT;
|
||||
strbuf_addstr(&head_ref, branch_top);
|
||||
strbuf_addstr(&head_ref, "HEAD");
|
||||
create_symref(head_ref.buf,
|
||||
remote_head_points_at->peer_ref->name,
|
||||
msg);
|
||||
if (create_symref(head_ref.buf,
|
||||
remote_head_points_at->peer_ref->name,
|
||||
msg) < 0)
|
||||
die(_("unable to update %s"), head_ref.buf);
|
||||
strbuf_release(&head_ref);
|
||||
}
|
||||
}
|
||||
|
||||
@ -647,7 +654,8 @@ static void update_head(const struct ref *our, const struct ref *remote,
|
||||
const char *head;
|
||||
if (our && skip_prefix(our->name, "refs/heads/", &head)) {
|
||||
/* Local default branch link */
|
||||
create_symref("HEAD", our->name, NULL);
|
||||
if (create_symref("HEAD", our->name, NULL) < 0)
|
||||
die(_("unable to update HEAD"));
|
||||
if (!option_bare) {
|
||||
update_ref(msg, "HEAD", our->old_oid.hash, NULL, 0,
|
||||
UPDATE_REFS_DIE_ON_ERR);
|
||||
@ -739,7 +747,7 @@ static int checkout(void)
|
||||
|
||||
static int write_one_config(const char *key, const char *value, void *data)
|
||||
{
|
||||
return git_config_set_multivar(key, value ? value : "true", "^$", 0);
|
||||
return git_config_set_multivar_gently(key, value ? value : "true", "^$", 0);
|
||||
}
|
||||
|
||||
static void write_config(struct string_list *config)
|
||||
@ -749,7 +757,7 @@ static void write_config(struct string_list *config)
|
||||
for (i = 0; i < config->nr; i++) {
|
||||
if (git_config_parse_parameter(config->items[i].string,
|
||||
write_one_config, NULL) < 0)
|
||||
die("unable to write parameters to config file");
|
||||
die(_("unable to write parameters to config file"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -974,6 +982,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
|
||||
remote = remote_get(option_origin);
|
||||
transport = transport_get(remote, remote->url[0]);
|
||||
transport_set_verbosity(transport, option_verbosity, option_progress);
|
||||
transport->family = family;
|
||||
|
||||
path = get_repo_path(remote->url[0], &is_bundle);
|
||||
is_local = option_local != 0 && path && !is_bundle;
|
||||
|
Reference in New Issue
Block a user