summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-10-19 04:34:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-10-19 04:34:03 (GMT)
commit4d87b38e6c1a73dbe744a30b9b3cdf88e69de7b4 (patch)
tree063642472b19f3d0e248f846df6bd14456622312 /builtin
parente27bfaaee37c4c9d7e94f945f82c3e452d2dc071 (diff)
parentae9af12287b2c37512f12c137173dde7ea5192a0 (diff)
downloadgit-4d87b38e6c1a73dbe744a30b9b3cdf88e69de7b4.zip
git-4d87b38e6c1a73dbe744a30b9b3cdf88e69de7b4.tar.gz
git-4d87b38e6c1a73dbe744a30b9b3cdf88e69de7b4.tar.bz2
Merge branch 'nd/status-refresh-progress'
"git status" learns to show progress bar when refreshing the index takes a long time. * nd/status-refresh-progress: status: show progress bar if refreshing the index takes too long
Diffstat (limited to 'builtin')
-rw-r--r--builtin/am.c2
-rw-r--r--builtin/commit.c10
2 files changed, 9 insertions, 3 deletions
diff --git a/builtin/am.c b/builtin/am.c
index d79f092..3ee9a9d 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -2328,7 +2328,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
/* Ensure a valid committer ident can be constructed */
git_committer_info(IDENT_STRICT);
- if (read_index_preload(&the_index, NULL) < 0)
+ if (read_index_preload(&the_index, NULL, 0) < 0)
die(_("failed to read the index"));
if (in_progress) {
diff --git a/builtin/commit.c b/builtin/commit.c
index 31b44e5..074bd9a 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1299,6 +1299,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
static int no_renames = -1;
static const char *rename_score_arg = (const char *)-1;
static struct wt_status s;
+ unsigned int progress_flag = 0;
int fd;
struct object_id oid;
static struct option builtin_status_options[] = {
@@ -1359,8 +1360,13 @@ int cmd_status(int argc, const char **argv, const char *prefix)
PATHSPEC_PREFER_FULL,
prefix, argv);
- read_cache_preload(&s.pathspec);
- refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, &s.pathspec, NULL, NULL);
+ if (status_format != STATUS_FORMAT_PORCELAIN &&
+ status_format != STATUS_FORMAT_PORCELAIN_V2)
+ progress_flag = REFRESH_PROGRESS;
+ read_index_preload(&the_index, &s.pathspec, progress_flag);
+ refresh_index(&the_index,
+ REFRESH_QUIET|REFRESH_UNMERGED|progress_flag,
+ &s.pathspec, NULL, NULL);
if (use_optional_locks())
fd = hold_locked_index(&index_lock, 0);