summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2008-05-14 17:03:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-05-15 23:12:43 (GMT)
commit5fdeacb0ca3935923ab988c81414c16080db6a32 (patch)
tree13ab5085d32769e3e56d8dbf4e5795ff0f0c7cba /read-cache.c
parent50fd9bd8430a957ea6c6674ce6112f375985abbc (diff)
downloadgit-5fdeacb0ca3935923ab988c81414c16080db6a32.zip
git-5fdeacb0ca3935923ab988c81414c16080db6a32.tar.gz
git-5fdeacb0ca3935923ab988c81414c16080db6a32.tar.bz2
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 0382804..47dd201 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))