Skip to content

Commit 226c051

Browse files
pcloudsgitster
authored andcommitted
status: enable untracked cache
update_index_if_able() is moved down so that the updated untracked cache could be written out. Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 76e6b09 commit 226c051

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

builtin/commit.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,13 +1364,14 @@ int cmd_status(int argc, const char **argv, const char *prefix)
13641364
refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, &s.pathspec, NULL, NULL);
13651365

13661366
fd = hold_locked_index(&index_lock, 0);
1367-
if (0 <= fd)
1368-
update_index_if_able(&the_index, &index_lock);
13691367

13701368
s.is_initial = get_sha1(s.reference, sha1) ? 1 : 0;
13711369
s.ignore_submodule_arg = ignore_submodule_arg;
13721370
wt_status_collect(&s);
13731371

1372+
if (0 <= fd)
1373+
update_index_if_able(&the_index, &index_lock);
1374+
13741375
if (s.relative_paths)
13751376
s.prefix = prefix;
13761377

wt-status.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,8 @@ static void wt_status_collect_untracked(struct wt_status *s)
585585
DIR_SHOW_OTHER_DIRECTORIES | DIR_HIDE_EMPTY_DIRECTORIES;
586586
if (s->show_ignored_files)
587587
dir.flags |= DIR_SHOW_IGNORED_TOO;
588+
else
589+
dir.untracked = the_index.untracked;
588590
setup_standard_excludes(&dir);
589591

590592
fill_directory(&dir, &s->pathspec);

0 commit comments

Comments
 (0)