summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2013-04-01 17:41:22 -0400
committerJames Moger <james.moger@gitblit.com>2013-04-01 17:41:22 -0400
commit0f47b2f605ed4119a6042b72d3499b223f40ec90 (patch)
treead9d11257a58ab36691f86fd91e9db6904cf8faa /src/test
parent19c1af5650cd58228f78308d98a7c22f37e3dec3 (diff)
downloadgitblit-0f47b2f605ed4119a6042b72d3499b223f40ec90.tar.gz
gitblit-0f47b2f605ed4119a6042b72d3499b223f40ec90.zip
Revised incremental push tags feature
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/com/gitblit/tests/GitBlitSuite.java12
-rw-r--r--src/test/java/com/gitblit/tests/GitServletTest.java8
2 files changed, 16 insertions, 4 deletions
diff --git a/src/test/java/com/gitblit/tests/GitBlitSuite.java b/src/test/java/com/gitblit/tests/GitBlitSuite.java
index b0179c37..64d792ec 100644
--- a/src/test/java/com/gitblit/tests/GitBlitSuite.java
+++ b/src/test/java/com/gitblit/tests/GitBlitSuite.java
@@ -153,7 +153,9 @@ public class GitBlitSuite {
enableTickets("ticgit.git");
enableDocs("ticgit.git");
showRemoteBranches("ticgit.git");
+ automaticallyTagBranchTips("ticgit.git");
showRemoteBranches("test/jgit.git");
+ automaticallyTagBranchTips("test/jgit.git");
}
}
@@ -198,6 +200,16 @@ public class GitBlitSuite {
}
}
+ private static void automaticallyTagBranchTips(String repositoryName) {
+ try {
+ RepositoryModel model = GitBlit.self().getRepositoryModel(repositoryName);
+ model.useIncrementalPushTags = true;
+ GitBlit.self().updateRepositoryModel(model.name, model, false);
+ } catch (GitBlitException g) {
+ g.printStackTrace();
+ }
+ }
+
public static void close(File repository) {
try {
File gitDir = FileKey.resolve(repository, FS.detect());
diff --git a/src/test/java/com/gitblit/tests/GitServletTest.java b/src/test/java/com/gitblit/tests/GitServletTest.java
index a05b3650..8d1fa104 100644
--- a/src/test/java/com/gitblit/tests/GitServletTest.java
+++ b/src/test/java/com/gitblit/tests/GitServletTest.java
@@ -248,7 +248,7 @@ public class GitServletTest {
w.close();
git.add().addFilepattern(file.getName()).call();
git.commit().setMessage("test commit").call();
- git.push().setPushAll().call();
+ git.push().setPushAll().setCredentialsProvider(new UsernamePasswordCredentialsProvider(account, password)).call();
GitBlitSuite.close(git);
}
@@ -283,7 +283,7 @@ public class GitServletTest {
git.commit().setMessage("test commit").call();
try {
- git.push().setPushAll().call();
+ git.push().setPushAll().setCredentialsProvider(new UsernamePasswordCredentialsProvider(account, password)).call();
assertTrue(false);
} catch (Exception e) {
assertTrue(e.getCause().getMessage().contains("access forbidden"));
@@ -293,7 +293,7 @@ public class GitServletTest {
model.isFrozen = false;
GitBlit.self().updateRepositoryModel(model.name, model, false);
- git.push().setPushAll().call();
+ git.push().setPushAll().setCredentialsProvider(new UsernamePasswordCredentialsProvider(account, password)).call();
GitBlitSuite.close(git);
}
@@ -317,7 +317,7 @@ public class GitServletTest {
git.add().addFilepattern(file.getName()).call();
git.commit().setMessage("test commit followed by push to non-bare repository").call();
try {
- git.push().setPushAll().call();
+ git.push().setPushAll().setCredentialsProvider(new UsernamePasswordCredentialsProvider(account, password)).call();
assertTrue(false);
} catch (Exception e) {
assertTrue(e.getCause().getMessage().contains("git-receive-pack not permitted"));