diff options
Diffstat (limited to 'unpack-trees.c')
-rw-r--r-- | unpack-trees.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/unpack-trees.c b/unpack-trees.c index 3c7f464fae..25740cb593 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -163,7 +163,7 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts, msgs[ERROR_BIND_OVERLAP] = _("Entry '%s' overlaps with '%s'. Cannot bind."); msgs[ERROR_SPARSE_NOT_UPTODATE_FILE] = - _("Cannot update sparse checkout: the following entries are not up-to-date:\n%s"); + _("Cannot update sparse checkout: the following entries are not up to date:\n%s"); msgs[ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN] = _("The following working tree files would be overwritten by sparse checkout update:\n%s"); msgs[ERROR_WOULD_LOSE_ORPHANED_REMOVED] = @@ -328,8 +328,7 @@ static struct progress *get_progress(struct unpack_trees_options *o) total++; } - return start_progress_delay(_("Checking out files"), - total, 50, 1); + return start_delayed_progress(_("Checking out files"), total); } static int check_updates(struct unpack_trees_options *o) @@ -369,6 +368,7 @@ static int check_updates(struct unpack_trees_options *o) if (should_update_submodules() && o->update && !o->dry_run) load_gitmodules_file(index, &state); + enable_delayed_checkout(&state); for (i = 0; i < index->cache_nr; i++) { struct cache_entry *ce = index->cache[i]; @@ -384,6 +384,7 @@ static int check_updates(struct unpack_trees_options *o) } } stop_progress(&progress); + errs |= finish_delayed_checkout(&state); if (o->update) git_attr_set_direction(GIT_ATTR_CHECKIN, NULL); return errs != 0; @@ -649,10 +650,10 @@ static int traverse_trees_recursive(int n, unsigned long dirmask, else if (i > 1 && are_same_oid(&names[i], &names[i - 2])) t[i] = t[i - 2]; else { - const unsigned char *sha1 = NULL; + const struct object_id *oid = NULL; if (dirmask & 1) - sha1 = names[i].oid->hash; - buf[nr_buf++] = fill_tree_descriptor(t+i, sha1); + oid = names[i].oid; + buf[nr_buf++] = fill_tree_descriptor(t + i, oid); } } @@ -1540,15 +1541,15 @@ static int verify_clean_subdirectory(const struct cache_entry *ce, int cnt = 0; if (S_ISGITLINK(ce->ce_mode)) { - unsigned char sha1[20]; - int sub_head = resolve_gitlink_ref(ce->name, "HEAD", sha1); + struct object_id oid; + int sub_head = resolve_gitlink_ref(ce->name, "HEAD", &oid); /* * If we are not going to update the submodule, then * we don't care. */ - if (!sub_head && !hashcmp(sha1, ce->oid.hash)) + if (!sub_head && !oidcmp(&oid, &ce->oid)) return 0; - return verify_clean_submodule(sub_head ? NULL : sha1_to_hex(sha1), + return verify_clean_submodule(sub_head ? NULL : oid_to_hex(&oid), ce, error_type, o); } |