View | Details | Raw Unified | Return to bug 371881 | Differences between
and this patch

Collapse All | Expand All

(-)a/tests/org.eclipse.orion.server.tests/src/org/eclipse/orion/server/tests/servlets/git/GitFetchTest.java (-1 / +7 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2011 IBM Corporation and others
2
 * Copyright (c) 2011, 2012 IBM Corporation and others
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 27-32 import org.eclipse.jgit.lib.Constants; Link Here
27
import org.eclipse.jgit.lib.ObjectId;
27
import org.eclipse.jgit.lib.ObjectId;
28
import org.eclipse.jgit.lib.Repository;
28
import org.eclipse.jgit.lib.Repository;
29
import org.eclipse.jgit.revwalk.RevCommit;
29
import org.eclipse.jgit.revwalk.RevCommit;
30
import org.eclipse.jgit.storage.file.FileBasedConfig;
30
import org.eclipse.jgit.transport.RemoteRefUpdate.Status;
31
import org.eclipse.jgit.transport.RemoteRefUpdate.Status;
31
import org.eclipse.jgit.transport.URIish;
32
import org.eclipse.jgit.transport.URIish;
32
import org.eclipse.orion.internal.server.core.IOUtilities;
33
import org.eclipse.orion.internal.server.core.IOUtilities;
Lines 510-515 public class GitFetchTest extends GitTest { Link Here
510
511
511
	@Test
512
	@Test
512
	public void testForcedFetch() throws Exception {
513
	public void testForcedFetch() throws Exception {
514
		// overwrite system settings, allow forced pushes, see bug 371881
515
		FileBasedConfig cfg = db.getConfig();
516
		cfg.setBoolean("receive", null, "denyNonFastforwards", false);
517
		cfg.save();
518
513
		URI workspaceLocation = createWorkspace(getMethodName());
519
		URI workspaceLocation = createWorkspace(getMethodName());
514
		JSONObject projectTop1 = createProjectOrLink(workspaceLocation, getMethodName() + "-top1", null);
520
		JSONObject projectTop1 = createProjectOrLink(workspaceLocation, getMethodName() + "-top1", null);
515
		IPath clonePathTop1 = new Path("file").append(projectTop1.getString(ProtocolConstants.KEY_ID)).makeAbsolute();
521
		IPath clonePathTop1 = new Path("file").append(projectTop1.getString(ProtocolConstants.KEY_ID)).makeAbsolute();
(-)a/tests/org.eclipse.orion.server.tests/src/org/eclipse/orion/server/tests/servlets/git/GitPushTest.java (+6 lines)
Lines 27-32 import org.eclipse.jgit.api.Git; Link Here
27
import org.eclipse.jgit.api.MergeResult.MergeStatus;
27
import org.eclipse.jgit.api.MergeResult.MergeStatus;
28
import org.eclipse.jgit.lib.Constants;
28
import org.eclipse.jgit.lib.Constants;
29
import org.eclipse.jgit.lib.Repository;
29
import org.eclipse.jgit.lib.Repository;
30
import org.eclipse.jgit.storage.file.FileBasedConfig;
30
import org.eclipse.jgit.storage.file.FileRepository;
31
import org.eclipse.jgit.storage.file.FileRepository;
31
import org.eclipse.jgit.transport.RemoteRefUpdate.Status;
32
import org.eclipse.jgit.transport.RemoteRefUpdate.Status;
32
import org.eclipse.jgit.transport.URIish;
33
import org.eclipse.jgit.transport.URIish;
Lines 672-677 public class GitPushTest extends GitTest { Link Here
672
673
673
	@Test
674
	@Test
674
	public void testForcedPush() throws Exception {
675
	public void testForcedPush() throws Exception {
676
		// overwrite system settings, allow forced pushes, see bug 371881
677
		FileBasedConfig cfg = db.getConfig();
678
		cfg.setBoolean("receive", null, "denyNonFastforwards", false);
679
		cfg.save();
680
675
		URI workspaceLocation = createWorkspace(getMethodName());
681
		URI workspaceLocation = createWorkspace(getMethodName());
676
		JSONObject projectTop1 = createProjectOrLink(workspaceLocation, getMethodName() + "-top1", null);
682
		JSONObject projectTop1 = createProjectOrLink(workspaceLocation, getMethodName() + "-top1", null);
677
		IPath clonePathTop1 = new Path("file").append(projectTop1.getString(ProtocolConstants.KEY_ID)).makeAbsolute();
683
		IPath clonePathTop1 = new Path("file").append(projectTop1.getString(ProtocolConstants.KEY_ID)).makeAbsolute();
(-)a/tests/org.eclipse.orion.server.tests/src/org/eclipse/orion/server/tests/servlets/git/GitTest.java (+7 lines)
Lines 55-60 import org.eclipse.jgit.lib.ObjectId; Link Here
55
import org.eclipse.jgit.lib.Ref;
55
import org.eclipse.jgit.lib.Ref;
56
import org.eclipse.jgit.lib.Repository;
56
import org.eclipse.jgit.lib.Repository;
57
import org.eclipse.jgit.lib.RepositoryCache;
57
import org.eclipse.jgit.lib.RepositoryCache;
58
import org.eclipse.jgit.storage.file.FileBasedConfig;
58
import org.eclipse.jgit.storage.file.FileRepository;
59
import org.eclipse.jgit.storage.file.FileRepository;
59
import org.eclipse.jgit.transport.URIish;
60
import org.eclipse.jgit.transport.URIish;
60
import org.eclipse.jgit.util.FS;
61
import org.eclipse.jgit.util.FS;
Lines 223-228 public abstract class GitTest extends FileSystemTest { Link Here
223
		Git git = new Git(db);
224
		Git git = new Git(db);
224
		git.add().addFilepattern(".").call();
225
		git.add().addFilepattern(".").call();
225
		git.commit().setMessage("Initial commit").call();
226
		git.commit().setMessage("Initial commit").call();
227
228
		// The system settings on eclipse.org was changed to receive.denyNonFastForward=true, see bug 343150.
229
		// Imitate the same setup when running tests locally, see bug 371881.
230
		FileBasedConfig cfg = db.getConfig();
231
		cfg.setBoolean("receive", null, "denyNonFastforwards", true);
232
		cfg.save();
226
	}
233
	}
227
234
228
	/**
235
	/**

Return to bug 371881