summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/submodule.c b/submodule.c
index 6b86744..31f391d 100644
--- a/submodule.c
+++ b/submodule.c
@@ -82,7 +82,7 @@ int is_staging_gitmodules_ok(struct index_state *istate)
if ((pos >= 0) && (pos < istate->cache_nr)) {
struct stat st;
if (lstat(GITMODULES_FILE, &st) == 0 &&
- ie_match_stat(istate, istate->cache[pos], &st, 0) & DATA_CHANGED)
+ ie_modified(istate, istate->cache[pos], &st, 0) & DATA_CHANGED)
return 0;
}
@@ -1280,10 +1280,12 @@ struct submodule_parallel_fetch {
/* Pending fetches by OIDs */
struct fetch_task **oid_fetch_tasks;
int oid_fetch_tasks_nr, oid_fetch_tasks_alloc;
+
+ struct strbuf submodules_with_errors;
};
#define SPF_INIT {0, ARGV_ARRAY_INIT, NULL, NULL, 0, 0, 0, 0, \
STRING_LIST_INIT_DUP, \
- NULL, 0, 0}
+ NULL, 0, 0, STRBUF_INIT}
static int get_fetch_recurse_config(const struct submodule *submodule,
struct submodule_parallel_fetch *spf)
@@ -1547,7 +1549,10 @@ static int fetch_finish(int retvalue, struct strbuf *err,
struct string_list_item *it;
struct oid_array *commits;
- if (retvalue)
+ if (!task || !task->sub)
+ BUG("callback cookie bogus");
+
+ if (retvalue) {
/*
* NEEDSWORK: This indicates that the overall fetch
* failed, even though there may be a subsequent fetch
@@ -1557,8 +1562,9 @@ static int fetch_finish(int retvalue, struct strbuf *err,
*/
spf->result = 1;
- if (!task || !task->sub)
- BUG("callback cookie bogus");
+ strbuf_addf(&spf->submodules_with_errors, "\t%s\n",
+ task->sub->name);
+ }
/* Is this the second time we process this submodule? */
if (task->commits)
@@ -1627,6 +1633,11 @@ int fetch_populated_submodules(struct repository *r,
&spf,
"submodule", "parallel/fetch");
+ if (spf.submodules_with_errors.len > 0)
+ fprintf(stderr, _("Errors during submodule fetch:\n%s"),
+ spf.submodules_with_errors.buf);
+
+
argv_array_clear(&spf.args);
out:
free_submodules_oids(&spf.changed_submodule_names);
@@ -1811,7 +1822,7 @@ out:
void submodule_unset_core_worktree(const struct submodule *sub)
{
char *config_path = xstrfmt("%s/modules/%s/config",
- get_git_common_dir(), sub->name);
+ get_git_dir(), sub->name);
if (git_config_set_in_file_gently(config_path, "core.worktree", NULL))
warning(_("Could not unset core.worktree setting in submodule '%s'"),
@@ -1914,7 +1925,7 @@ int submodule_move_head(const char *path,
ABSORB_GITDIR_RECURSE_SUBMODULES);
} else {
char *gitdir = xstrfmt("%s/modules/%s",
- get_git_common_dir(), sub->name);
+ get_git_dir(), sub->name);
connect_work_tree_and_git_dir(path, gitdir, 0);
free(gitdir);
@@ -1924,7 +1935,7 @@ int submodule_move_head(const char *path,
if (old_head && (flags & SUBMODULE_MOVE_HEAD_FORCE)) {
char *gitdir = xstrfmt("%s/modules/%s",
- get_git_common_dir(), sub->name);
+ get_git_dir(), sub->name);
connect_work_tree_and_git_dir(path, gitdir, 1);
free(gitdir);
}