summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2015-03-08 10:12:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-03-12 20:45:17 (GMT)
commit226c051adb0f64772f807287e130a6a546b95fbd (patch)
tree01e1240cc33b4bb915d9aed9c3ef57fea32da44a /builtin
parent76e6b090a0b9b1e83b8e467d1b64f250f66c3f54 (diff)
downloadgit-226c051adb0f64772f807287e130a6a546b95fbd.zip
git-226c051adb0f64772f807287e130a6a546b95fbd.tar.gz
git-226c051adb0f64772f807287e130a6a546b95fbd.tar.bz2
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 <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/commit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 961e467..fe380a9 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1364,13 +1364,14 @@ int cmd_status(int argc, const char **argv, const char *prefix)
refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, &s.pathspec, NULL, NULL);
fd = hold_locked_index(&index_lock, 0);
- if (0 <= fd)
- update_index_if_able(&the_index, &index_lock);
s.is_initial = get_sha1(s.reference, sha1) ? 1 : 0;
s.ignore_submodule_arg = ignore_submodule_arg;
wt_status_collect(&s);
+ if (0 <= fd)
+ update_index_if_able(&the_index, &index_lock);
+
if (s.relative_paths)
s.prefix = prefix;