summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 50fd9bd)
raw | patch | inline | side by side (parent: 50fd9bd)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Wed, 14 May 2008 17:03:45 +0000 (18:03 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 15 May 2008 23:12:43 +0000 (16:12 -0700) |
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>
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>
Documentation/git-update-index.txt | patch | blob | history | |
builtin-update-index.c | patch | blob | history | |
cache.h | patch | blob | history | |
read-cache.c | patch | blob | history |
index 66be18ef36696c7422acd46510b16d756962fb8d..06640603c4b2cbd3f1825f33706544db8cbfe492 100644 (file)
[--cacheinfo <mode> <object> <file>]\*
[--chmod=(+|-)x]
[--assume-unchanged | --no-assume-unchanged]
+ [--ignore-submodules]
[--really-refresh] [--unresolve] [--again | -g]
[--info-only] [--index-info]
[-z] [--stdin]
default behavior is to error out. This option makes
git-update-index continue anyway.
+--ignore-submodules:
+ Do not try to update submodules. This option is only respected
+ when passed before --refresh.
+
--unmerged::
If --refresh finds unmerged changes in the index, the default
behavior is to error out. This option makes git-update-index
diff --git a/builtin-update-index.c b/builtin-update-index.c
index a8795d3d5fea9f340dfe21a71190f120c63856cd..d4c85c0cbc6fec3d526cc57d8b748b1f1a82b9a1 100644 (file)
--- a/builtin-update-index.c
+++ b/builtin-update-index.c
refresh_flags |= REFRESH_QUIET;
continue;
}
+ if (!strcmp(path, "--ignore-submodules")) {
+ refresh_flags |= REFRESH_IGNORE_SUBMODULES;
+ continue;
+ }
if (!strcmp(path, "--add")) {
allow_add = 1;
continue;
index 093f04cec0459e67c54f3fc5b536f59fb0f343dc..b753b494979728b818f2c8a75af7aeab5ee73aee 100644 (file)
--- a/cache.h
+++ b/cache.h
#define REFRESH_UNMERGED 0x0002 /* allow unmerged */
#define REFRESH_QUIET 0x0004 /* be quiet about it */
#define REFRESH_IGNORE_MISSING 0x0008 /* ignore non-existent */
+#define REFRESH_IGNORE_SUBMODULES 0x0008 /* ignore submodules */
extern int refresh_index(struct index_state *, unsigned int flags, const char **pathspec, char *seen);
struct lock_file {
diff --git a/read-cache.c b/read-cache.c
index 0382804e7694e9a0e87cc2dc8340187ddeea2d64..47dd2013fb937c6aaaf9fecd156c87f44fee4780 100644 (file)
--- 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))