aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2018-03-13 02:20:29 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2018-03-13 02:20:29 +0100
commite23b09ad6efc35f6574cfefd4467ad20e5212ff2 (patch)
tree2496db04e5c6c321c5df516b6e92c3c7005c90cd /org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit
parent6f82de449fa8c2e30b60afedf9b557d879fdde8c (diff)
downloadjgit-e23b09ad6efc35f6574cfefd4467ad20e5212ff2.tar.gz
jgit-e23b09ad6efc35f6574cfefd4467ad20e5212ff2.zip
Implement --force option in FetchCommand and CLI fetch command
Change-Id: I42cdb57b8fb54ce466d1958391f12f911045327f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit')
-rw-r--r--org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/FetchTest.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/FetchTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/FetchTest.java
index 9685d4517a..dde1a332db 100644
--- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/FetchTest.java
+++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/FetchTest.java
@@ -92,6 +92,19 @@ public class FetchTest extends CLIRepositoryTestCase {
}
@Test
+ public void testFetchForceUpdate() throws Exception {
+ String[] result = execute(
+ "git fetch test refs/heads/master:refs/remotes/origin/master");
+ assertEquals(" * [new branch] master -> origin/master",
+ result[1]);
+ assertEquals(" * [new tag] tag -> tag", result[2]);
+ remoteGit.commit().setAmend(true).setMessage("amended").call();
+ result = execute(
+ "git fetch -f test refs/heads/master:refs/remotes/origin/master");
+ assertEquals("", result[0]);
+ }
+
+ @Test
public void testFetchNoTags() throws Exception {
String[] result = execute("git fetch --no-tags test refs/heads/master:refs/remotes/origin/master");
assertEquals(" * [new branch] master -> origin/master",