diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2018-03-13 02:20:29 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2018-03-13 02:20:29 +0100 |
commit | e23b09ad6efc35f6574cfefd4467ad20e5212ff2 (patch) | |
tree | 2496db04e5c6c321c5df516b6e92c3c7005c90cd /org.eclipse.jgit.pgm.test/tst | |
parent | 6f82de449fa8c2e30b60afedf9b557d879fdde8c (diff) | |
download | jgit-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')
-rw-r--r-- | org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/FetchTest.java | 13 |
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", |