]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/commit.c
status: show progress bar if refreshing the index takes too long
[thirdparty/git.git] / builtin / commit.c
index 0d9828e29ebe89f037e68761d5cd5b407339cd48..752346306690a8aa7421882c70660b4af3ec5cbc 100644 (file)
@@ -1295,6 +1295,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[] = {
@@ -1355,8 +1356,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);