aboutsummaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2008-05-14 18:03:45 +0100
committerJunio C Hamano <gitster@pobox.com>2008-05-15 16:12:43 -0700
commit5fdeacb0ca3935923ab988c81414c16080db6a32 (patch)
tree13ab5085d32769e3e56d8dbf4e5795ff0f0c7cba /read-cache.c
parent50fd9bd8430a957ea6c6674ce6112f375985abbc (diff)
downloadgit-5fdeacb0ca3935923ab988c81414c16080db6a32.tar.gz
git-5fdeacb0ca3935923ab988c81414c16080db6a32.tar.xz
Teach update-index about --ignore-submodules
Like with the diff machinery, update-index should sometimes just ignore submodules (e.g. to determine a clean state before a rebase). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/read-cache.c b/read-cache.c
index 0382804e7..47dd2013f 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -942,6 +942,7 @@ int refresh_index(struct index_state *istate, unsigned int flags, const char **p
int allow_unmerged = (flags & REFRESH_UNMERGED) != 0;
int quiet = (flags & REFRESH_QUIET) != 0;
int not_new = (flags & REFRESH_IGNORE_MISSING) != 0;
+ int ignore_submodules = (flags & REFRESH_IGNORE_SUBMODULES) != 0;
unsigned int options = really ? CE_MATCH_IGNORE_VALID : 0;
for (i = 0; i < istate->cache_nr; i++) {
@@ -949,6 +950,9 @@ int refresh_index(struct index_state *istate, unsigned int flags, const char **p
int cache_errno = 0;
ce = istate->cache[i];
+ if (ignore_submodules && S_ISGITLINK(ce->ce_mode))
+ continue;
+
if (ce_stage(ce)) {
while ((i < istate->cache_nr) &&
! strcmp(istate->cache[i]->name, ce->name))