diff options
Diffstat (limited to 'org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestRepository.java')
-rw-r--r-- | org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestRepository.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestRepository.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestRepository.java index 62ecd00fe0..1eccf133f8 100644 --- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestRepository.java +++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestRepository.java @@ -3,6 +3,7 @@ * Copyright (C) 2010, Jens Baumgart <jens.baumgart@sap.com> * Copyright (C) 2012, Robin Stocker <robin@nibor.org> * Copyright (C) 2012, François Rey <eclipse.org_@_francois_._rey_._name> + * Copyright (C) 2015, Obeo * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -362,6 +363,21 @@ public class TestRepository { } /** + * Remove the given resource form the index. + * + * @param file + * @throws NoFilepatternException + * @throws GitAPIException + */ + public void removeFromIndex(File file) throws NoFilepatternException, GitAPIException { + String repoPath = getRepoRelativePath(new Path(file.getPath()) + .toString()); + try (Git git = new Git(repository)) { + git.rm().addFilepattern(repoPath).call(); + } + } + + /** * Appends content to end of given file. * * @param file |