From 5f22d67270466097713a0757e4f0f9f06cb06807 Mon Sep 17 00:00:00 2001 From: Robin Rosenberg Date: Sun, 1 May 2011 23:17:57 +0200 Subject: [PATCH] Ignore submodule commits during checkout Submodules are supposed to be handled by separate operations, so we should ignore them on checkout, just like C Git does. This fix does not add submodule support. We just try harder to ignore them. Bug: 343566 Change-Id: I2c5ae1024ea7bb57adf27072da6acc9643018eda Signed-off-by: Robin Rosenberg --- .../src/org/eclipse/jgit/dircache/DirCacheCheckout.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java index e3c225ff6..9a9940898 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java @@ -417,7 +417,13 @@ public boolean checkout() throws IOException { if (!file.getParentFile().mkdirs()) { // ignore } + DirCacheEntry entry = dc.getEntry(path); + + // submodules are handled with separate operations + if (FileMode.GITLINK.equals(entry.getRawMode())) + continue; + checkoutEntry(repo, file, entry); }