You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2013/07/15 13:24:53 UTC
[42/50] [abbrv] move jgit provider to scm-project
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/list/JGitListCommand.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/list/JGitListCommand.java b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/list/JGitListCommand.java
new file mode 100644
index 0000000..09889e0
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/list/JGitListCommand.java
@@ -0,0 +1,76 @@
+package org.apache.maven.scm.provider.git.jgit.command.list;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFile;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmFileStatus;
+import org.apache.maven.scm.ScmVersion;
+import org.apache.maven.scm.command.list.AbstractListCommand;
+import org.apache.maven.scm.command.list.ListScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.git.command.GitCommand;
+import org.apache.maven.scm.provider.git.jgit.command.JGitUtils;
+import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository;
+import org.eclipse.jgit.api.Git;
+import org.eclipse.jgit.lib.Ref;
+import org.eclipse.jgit.transport.CredentialsProvider;
+
+/**
+ * @author Dominik Bartholdi (imod)
+ */
+public class JGitListCommand
+ extends AbstractListCommand
+ implements GitCommand
+{
+
+ @Override
+ protected ListScmResult executeListCommand( ScmProviderRepository repo, ScmFileSet fileSet, boolean recursive,
+ ScmVersion scmVersion )
+ throws ScmException
+ {
+
+ try
+ {
+ Git git = Git.open( fileSet.getBasedir() );
+ CredentialsProvider credentials =
+ JGitUtils.prepareSession( getLogger(), git, (GitScmProviderRepository) repo );
+
+ List<ScmFile> list = new ArrayList<ScmFile>();
+ Collection<Ref> lsResult = git.lsRemote().setCredentialsProvider( credentials ).call();
+ for ( Ref ref : lsResult )
+ {
+ getLogger().debug( ref.getObjectId().getName() + " " + ref.getTarget().getName() );
+ list.add( new ScmFile( ref.getName(), ScmFileStatus.CHECKED_IN ) );
+ }
+
+ return new ListScmResult( "JGit ls-remote", list );
+ }
+ catch ( Exception e )
+ {
+ throw new ScmException( "JGit ls-remote failure!", e );
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/remoteinfo/JGitRemoteInfoCommand.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/remoteinfo/JGitRemoteInfoCommand.java b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/remoteinfo/JGitRemoteInfoCommand.java
new file mode 100644
index 0000000..0d98625
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/remoteinfo/JGitRemoteInfoCommand.java
@@ -0,0 +1,85 @@
+package org.apache.maven.scm.provider.git.jgit.command.remoteinfo;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.maven.scm.CommandParameters;
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.command.remoteinfo.AbstractRemoteInfoCommand;
+import org.apache.maven.scm.command.remoteinfo.RemoteInfoScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.git.command.GitCommand;
+import org.apache.maven.scm.provider.git.jgit.command.JGitUtils;
+import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository;
+import org.eclipse.jgit.api.Git;
+import org.eclipse.jgit.api.LsRemoteCommand;
+import org.eclipse.jgit.lib.Ref;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.transport.CredentialsProvider;
+
+/**
+ * @author Dominik Bartholdi (imod)
+ */
+public class JGitRemoteInfoCommand
+ extends AbstractRemoteInfoCommand
+ implements GitCommand
+{
+
+ @Override
+ public RemoteInfoScmResult executeRemoteInfoCommand( ScmProviderRepository repository, ScmFileSet fileSet,
+ CommandParameters parameters )
+ throws ScmException
+ {
+
+ GitScmProviderRepository repo = (GitScmProviderRepository) repository;
+ try
+ {
+ Git git = Git.open( fileSet.getBasedir() );
+ CredentialsProvider credentials = JGitUtils.getCredentials( repo );
+
+ LsRemoteCommand lsCommand =
+ git.lsRemote().setRemote( repo.getPushUrl() ).setCredentialsProvider( credentials );
+
+ Map<String, String> tag = new HashMap<String, String>();
+ Collection<Ref> allTags = lsCommand.setHeads( false ).setTags(true).call();
+ for ( Ref ref : allTags )
+ {
+ tag.put( Repository.shortenRefName(ref.getName()), ref.getObjectId().name() );
+ }
+
+ Map<String, String> heads = new HashMap<String, String>();
+ Collection<Ref> allHeads = lsCommand.setHeads(true).setTags( false ).call();
+ for ( Ref ref : allHeads )
+ {
+ heads.put( Repository.shortenRefName(ref.getName()), ref.getObjectId().name() );
+ }
+
+ return new RemoteInfoScmResult( "JGit remoteinfo", heads, tag );
+ }
+ catch ( Exception e )
+ {
+ throw new ScmException( "JGit remoteinfo failure!", e );
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/status/JGitStatusCommand.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/status/JGitStatusCommand.java b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/status/JGitStatusCommand.java
new file mode 100644
index 0000000..db2f9ee
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/status/JGitStatusCommand.java
@@ -0,0 +1,84 @@
+package org.apache.maven.scm.provider.git.jgit.command.status;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFile;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmFileStatus;
+import org.apache.maven.scm.command.status.AbstractStatusCommand;
+import org.apache.maven.scm.command.status.StatusScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.git.command.GitCommand;
+import org.eclipse.jgit.api.Git;
+import org.eclipse.jgit.api.Status;
+
+/**
+ * @author <a href="mailto:struberg@yahoo.de">Mark Struberg</a>
+ * @author Dominik Bartholdi (imod)
+ * @version $Id: JGitStatusCommand.java 894145 2009-12-28 10:13:39Z struberg $
+ */
+public class JGitStatusCommand
+ extends AbstractStatusCommand
+ implements GitCommand
+{
+ /**
+ * {@inheritDoc}
+ */
+ protected StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet fileSet )
+ throws ScmException
+ {
+ try
+ {
+ Git git = Git.open( fileSet.getBasedir() );
+ Status status = git.status().call();
+ List<ScmFile> changedFiles = getFileStati( status );
+
+ return new StatusScmResult( "JGit status", changedFiles );
+ }
+ catch ( Exception e )
+ {
+ throw new ScmException( "JGit status failure!", e );
+ }
+ }
+
+ private List<ScmFile> getFileStati( Status status )
+ {
+ List<ScmFile> all = new ArrayList<ScmFile>();
+ addAsScmFiles( all, status.getAdded(), ScmFileStatus.ADDED );
+ addAsScmFiles( all, status.getChanged(), ScmFileStatus.UPDATED );
+ addAsScmFiles( all, status.getConflicting(), ScmFileStatus.CONFLICT );
+ addAsScmFiles( all, status.getModified(), ScmFileStatus.MODIFIED );
+ addAsScmFiles( all, status.getRemoved(), ScmFileStatus.DELETED );
+ return all;
+ }
+
+ private void addAsScmFiles( Collection<ScmFile> all, Collection<String> files, ScmFileStatus status )
+ {
+ for ( String f : files )
+ {
+ all.add( new ScmFile( f, status ) );
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/tag/JGitTagCommand.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/tag/JGitTagCommand.java b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/tag/JGitTagCommand.java
new file mode 100644
index 0000000..b4011bc
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/tag/JGitTagCommand.java
@@ -0,0 +1,118 @@
+package org.apache.maven.scm.provider.git.jgit.command.tag;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFile;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmFileStatus;
+import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.ScmTagParameters;
+import org.apache.maven.scm.command.tag.AbstractTagCommand;
+import org.apache.maven.scm.command.tag.TagScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.git.command.GitCommand;
+import org.apache.maven.scm.provider.git.jgit.command.JGitUtils;
+import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository;
+import org.codehaus.plexus.util.StringUtils;
+import org.eclipse.jgit.api.Git;
+import org.eclipse.jgit.lib.Constants;
+import org.eclipse.jgit.lib.Ref;
+import org.eclipse.jgit.revwalk.RevCommit;
+import org.eclipse.jgit.revwalk.RevWalk;
+import org.eclipse.jgit.transport.RefSpec;
+import org.eclipse.jgit.treewalk.TreeWalk;
+
+/**
+ * @author <a href="mailto:struberg@yahoo.de">Mark Struberg</a>
+ * @author Dominik Bartholdi (imod)
+ * @version $Id $
+ */
+public class JGitTagCommand
+ extends AbstractTagCommand
+ implements GitCommand
+{
+
+ public ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet fileSet, String tag, String message )
+ throws ScmException
+ {
+ return executeTagCommand( repo, fileSet, tag, new ScmTagParameters( message ) );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet fileSet, String tag,
+ ScmTagParameters scmTagParameters )
+ throws ScmException
+ {
+ if ( tag == null || StringUtils.isEmpty( tag.trim() ) )
+ {
+ throw new ScmException( "tag name must be specified" );
+ }
+
+ if ( !fileSet.getFileList().isEmpty() )
+ {
+ throw new ScmException( "This provider doesn't support tagging subsets of a directory" );
+ }
+
+ String escapedTagName = tag.trim().replace(' ', '_');
+
+ try
+ {
+ Git git = Git.open( fileSet.getBasedir() );
+
+ // tag the revision
+ String tagMessage = scmTagParameters.getMessage();
+ Ref tagRef = git.tag().setName( escapedTagName ).setMessage( tagMessage ).setForceUpdate( false ).call();
+
+ if ( repo.isPushChanges() )
+ {
+ getLogger().info( "push tag [" + escapedTagName + "] to remote..." );
+ JGitUtils.push( getLogger(), git, (GitScmProviderRepository) repo, new RefSpec( Constants.R_TAGS + escapedTagName ) );
+ }
+
+ // search for the tagged files
+ RevWalk revWalk = new RevWalk(git.getRepository());
+ RevCommit commit = revWalk.parseCommit(tagRef.getObjectId());
+
+ final TreeWalk walk = new TreeWalk(git.getRepository());
+ walk.reset(); // drop the first empty tree, which we do not need here
+ walk.setRecursive(true);
+ walk.addTree(commit.getTree());
+
+ List<ScmFile> taggedFiles = new ArrayList<ScmFile>();
+ while (walk.next()) {
+ taggedFiles.add( new ScmFile( walk.getPathString(), ScmFileStatus.CHECKED_OUT));
+ }
+
+ return new TagScmResult( "JGit tag", taggedFiles );
+ }
+ catch ( Exception e )
+ {
+ throw new ScmException( "JGit tag failure!", e );
+ }
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/branch/JGitBranchCommandTckTest.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/branch/JGitBranchCommandTckTest.java b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/branch/JGitBranchCommandTckTest.java
new file mode 100644
index 0000000..9e133ac
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/branch/JGitBranchCommandTckTest.java
@@ -0,0 +1,38 @@
+package org.apache.maven.scm.provider.git.jgit.command.branch;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.scm.provider.git.GitScmTestUtils;
+import org.apache.maven.scm.provider.git.command.branch.GitBranchCommandTckTest;
+
+/**
+ * @author Dominik Bartholdi (imod)
+ */
+public class JGitBranchCommandTckTest
+ extends GitBranchCommandTckTest
+{
+ /** {@inheritDoc} */
+ public String getScmUrl()
+ throws Exception
+ {
+ return GitScmTestUtils.getScmUrl( getRepositoryRoot(), "jgit" );
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/changelog/JGitChangeLogCommandTckTest.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/changelog/JGitChangeLogCommandTckTest.java b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/changelog/JGitChangeLogCommandTckTest.java
new file mode 100644
index 0000000..b8d72bb
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/changelog/JGitChangeLogCommandTckTest.java
@@ -0,0 +1,39 @@
+package org.apache.maven.scm.provider.git.jgit.command.changelog;
+
+import org.apache.maven.scm.provider.git.GitScmTestUtils;
+import org.apache.maven.scm.provider.git.command.changelog.GitChangeLogCommandTckTest;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @author <a href="mailto:struberg@yahoo.de">Mark Struberg</a>
+ */
+public class JGitChangeLogCommandTckTest
+ extends GitChangeLogCommandTckTest
+{
+ /**
+ * {@inheritDoc}
+ */
+ public String getScmUrl()
+ throws Exception
+ {
+ return GitScmTestUtils.getScmUrl( getRepositoryRoot(), "jgit" );
+ }
+}
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/checkin/JGitCheckInCommandTckTest.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/checkin/JGitCheckInCommandTckTest.java b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/checkin/JGitCheckInCommandTckTest.java
new file mode 100644
index 0000000..ca61f63
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/checkin/JGitCheckInCommandTckTest.java
@@ -0,0 +1,40 @@
+package org.apache.maven.scm.provider.git.jgit.command.checkin;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.scm.provider.git.GitScmTestUtils;
+import org.apache.maven.scm.provider.git.command.checkin.GitCheckInCommandTckTest;
+
+/**
+ * @author <a href="mailto:struberg@yahoo.de">Mark Struberg</a>
+ * @version $Id: JGitCheckInCommandTckTest.java 894145 2009-12-28 10:13:39Z struberg $
+ */
+public class JGitCheckInCommandTckTest
+ extends GitCheckInCommandTckTest
+{
+ /**
+ * {@inheritDoc}
+ */
+ public String getScmUrl()
+ throws Exception
+ {
+ return GitScmTestUtils.getScmUrl( getRepositoryRoot(), "jgit" );
+ }
+}
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/checkout/JGitCheckOutCommandTckTest.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/checkout/JGitCheckOutCommandTckTest.java b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/checkout/JGitCheckOutCommandTckTest.java
new file mode 100644
index 0000000..c55664c
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/checkout/JGitCheckOutCommandTckTest.java
@@ -0,0 +1,41 @@
+package org.apache.maven.scm.provider.git.jgit.command.checkout;
+
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.scm.provider.git.GitScmTestUtils;
+import org.apache.maven.scm.provider.git.command.checkout.GitCheckOutCommandTckTest;
+
+/**
+ * @author <a href="mailto:struberg@yahoo.de">Mark Struberg</a>
+ * @version $Id: JGitCheckOutCommandTckTest.java 894145 2009-12-28 10:13:39Z struberg $
+ */
+public class JGitCheckOutCommandTckTest
+ extends GitCheckOutCommandTckTest
+{
+ /**
+ * {@inheritDoc}
+ */
+ public String getScmUrl()
+ throws Exception
+ {
+ return GitScmTestUtils.getScmUrl( getRepositoryRoot(), "jgit" );
+ }
+}
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/remoteinfo/JGitRemoteInfoCommandTckTest.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/remoteinfo/JGitRemoteInfoCommandTckTest.java b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/remoteinfo/JGitRemoteInfoCommandTckTest.java
new file mode 100644
index 0000000..f94c536
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/remoteinfo/JGitRemoteInfoCommandTckTest.java
@@ -0,0 +1,42 @@
+package org.apache.maven.scm.provider.git.jgit.command.remoteinfo;
+
+import org.apache.maven.scm.command.remoteinfo.RemoteInfoScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.git.GitScmTestUtils;
+import org.apache.maven.scm.provider.git.command.remoteinfo.AbstractGitRemoteInfoCommandTckTest;
+import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository;
+
+/**
+ *
+ * @author Dominik Bartholdi (imod)
+ */
+public class JGitRemoteInfoCommandTckTest extends AbstractGitRemoteInfoCommandTckTest
+{
+
+ @Override
+ protected void checkResult( RemoteInfoScmResult result )
+ {
+ assertEquals( 1, result.getBranches().size() );
+ assertEquals( "92f139dfec4d1dfb79c3cd2f94e83bf13129668b", result.getBranches().get( "master" ) );
+
+ assertEquals( 0, result.getTags().size() );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getScmUrl()
+ throws Exception
+ {
+ String scmUrl = GitScmTestUtils.getScmUrl( getRepositoryRoot(), "jgit" );
+ System.out.println("SCM: "+scmUrl);
+ return scmUrl;
+ }
+
+ @Override
+ protected ScmProviderRepository getScmProviderRepository()
+ throws Exception
+ {
+ return new GitScmProviderRepository( getScmUrl().substring( "scm:jgit:".length() ) );
+ }
+}
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/status/JGitStatusCommandTckTest.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/status/JGitStatusCommandTckTest.java b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/status/JGitStatusCommandTckTest.java
new file mode 100644
index 0000000..d9bf5dd
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/status/JGitStatusCommandTckTest.java
@@ -0,0 +1,40 @@
+package org.apache.maven.scm.provider.git.jgit.command.status;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.scm.provider.git.GitScmTestUtils;
+import org.apache.maven.scm.provider.git.command.status.GitStatusCommandTckTest;
+
+/**
+ * @author <a href="mailto:struberg@yahoo.de">Mark Strubergr</a>
+ * @version $Id: JGitStatusCommandTckTest.java 894145 2009-12-28 10:13:39Z struberg $
+ */
+public class JGitStatusCommandTckTest
+ extends GitStatusCommandTckTest
+{
+ /**
+ * {@inheritDoc}
+ */
+ public String getScmUrl()
+ throws Exception
+ {
+ return GitScmTestUtils.getScmUrl( getRepositoryRoot(), "jgit" );
+ }
+}
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/tag/JGitTagCommandTckTest.java
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/tag/JGitTagCommandTckTest.java b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/tag/JGitTagCommandTckTest.java
new file mode 100644
index 0000000..708e928
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/java/org/apache/maven/scm/provider/git/jgit/command/tag/JGitTagCommandTckTest.java
@@ -0,0 +1,42 @@
+package org.apache.maven.scm.provider.git.jgit.command.tag;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.scm.provider.git.GitScmTestUtils;
+import org.apache.maven.scm.provider.git.command.tag.GitTagCommandTckTest;
+
+/**
+ * This test tests the tag command.
+ *
+ * @author <a href="mailto:struberg@yahoo.de">Mark Struberg</a>
+ * @version $Id: JGitTagCommandTckTest.java 894145 2009-12-28 10:13:39Z struberg $
+ */
+public class JGitTagCommandTckTest
+ extends GitTagCommandTckTest
+{
+ /**
+ * {@inheritDoc}
+ */
+ public String getScmUrl()
+ throws Exception
+ {
+ return GitScmTestUtils.getScmUrl( getRepositoryRoot(), "jgit" );
+ }
+}
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/HEAD
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/HEAD b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/HEAD
new file mode 100644
index 0000000..cb43805
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/HEAD
@@ -0,0 +1 @@
+ref: refs/heads/master
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/config
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/config b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/config
new file mode 100644
index 0000000..b209dc3
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/config
@@ -0,0 +1,4 @@
+[core]
+ repositoryformatversion = 0
+ filemode = true
+ bare = true
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/description
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/description b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/description
new file mode 100644
index 0000000..31be40f
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/description
@@ -0,0 +1 @@
+Unnamed repository; edit this file to name it for gitweb.
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/applypatch-msg
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/applypatch-msg b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/applypatch-msg
new file mode 100644
index 0000000..02de1ef
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/applypatch-msg
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# An example hook script to check the commit log message taken by
+# applypatch from an e-mail message.
+#
+# The hook should exit with non-zero status after issuing an
+# appropriate message if it wants to stop the commit. The hook is
+# allowed to edit the commit message file.
+#
+# To enable this hook, make this file executable.
+
+. git-sh-setup
+test -x "$GIT_DIR/hooks/commit-msg" &&
+ exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"}
+:
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/applypatch-msg.sample
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/applypatch-msg.sample b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/applypatch-msg.sample
new file mode 100644
index 0000000..94338db
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/applypatch-msg.sample
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# An example hook script to check the commit log message taken by
+# applypatch from an e-mail message.
+#
+# The hook should exit with non-zero status after issuing an
+# appropriate message if it wants to stop the commit. The hook is
+# allowed to edit the commit message file.
+#
+# To enable this hook, rename this file to "applypatch-msg".
+
+. git-sh-setup
+test -x "$GIT_DIR/hooks/commit-msg" &&
+ exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"}
+:
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/commit-msg
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/commit-msg b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/commit-msg
new file mode 100644
index 0000000..c5cdb9d
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/commit-msg
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+# An example hook script to check the commit log message.
+# Called by git-commit with one argument, the name of the file
+# that has the commit message. The hook should exit with non-zero
+# status after issuing an appropriate message if it wants to stop the
+# commit. The hook is allowed to edit the commit message file.
+#
+# To enable this hook, make this file executable.
+
+# Uncomment the below to add a Signed-off-by line to the message.
+# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
+# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
+
+# This example catches duplicate Signed-off-by lines.
+
+test "" = "$(grep '^Signed-off-by: ' "$1" |
+ sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
+ echo >&2 Duplicate Signed-off-by lines.
+ exit 1
+}
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/commit-msg.sample
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/commit-msg.sample b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/commit-msg.sample
new file mode 100644
index 0000000..729d7b6
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/commit-msg.sample
@@ -0,0 +1,24 @@
+#!/bin/sh
+#
+# An example hook script to check the commit log message.
+# Called by git-commit with one argument, the name of the file
+# that has the commit message. The hook should exit with non-zero
+# status after issuing an appropriate message if it wants to stop the
+# commit. The hook is allowed to edit the commit message file.
+#
+# To enable this hook, rename this file to "commit-msg".
+
+# Uncomment the below to add a Signed-off-by line to the message.
+# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
+# hook is more suited to it.
+#
+# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
+# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
+
+# This example catches duplicate Signed-off-by lines.
+
+test "" = "$(grep '^Signed-off-by: ' "$1" |
+ sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
+ echo >&2 Duplicate Signed-off-by lines.
+ exit 1
+}
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-commit
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-commit b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-commit
new file mode 100644
index 0000000..8be6f34
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-commit
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# An example hook script that is called after a successful
+# commit is made.
+#
+# To enable this hook, make this file executable.
+
+: Nothing
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-commit.sample
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-commit.sample b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-commit.sample
new file mode 100644
index 0000000..9d3b4be
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-commit.sample
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# An example hook script that is called after a successful
+# commit is made.
+#
+# To enable this hook, rename this file to "post-commit".
+
+: Nothing
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-receive
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-receive b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-receive
new file mode 100644
index 0000000..b70c8fd
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-receive
@@ -0,0 +1,16 @@
+#!/bin/sh
+#
+# An example hook script for the post-receive event
+#
+# This script is run after receive-pack has accepted a pack and the
+# repository has been updated. It is passed arguments in through stdin
+# in the form
+# <oldrev> <newrev> <refname>
+# For example:
+# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master
+#
+# see contrib/hooks/ for an sample, or uncomment the next line (on debian)
+#
+
+
+#. /usr/share/doc/git-core/contrib/hooks/post-receive-email
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-receive.sample
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-receive.sample b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-receive.sample
new file mode 100644
index 0000000..99499a0
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-receive.sample
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# An example hook script for the "post-receive" event.
+#
+# The "post-receive" script is run after receive-pack has accepted a pack
+# and the repository has been updated. It is passed arguments in through
+# stdin in the form
+# <oldrev> <newrev> <refname>
+# For example:
+# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master
+#
+# see contrib/hooks/ for an sample, or uncomment the next line and
+# rename the file to "post-receive".
+
+#. /usr/share/doc/git-core/contrib/hooks/post-receive-email
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-update
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-update b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-update
new file mode 100644
index 0000000..bcba893
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-update
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# An example hook script to prepare a packed repository for use over
+# dumb transports.
+#
+# To enable this hook, make this file executable by "chmod +x post-update".
+
+exec git-update-server-info
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-update.sample
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-update.sample b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-update.sample
new file mode 100644
index 0000000..c0b7c44
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/post-update.sample
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# An example hook script to prepare a packed repository for use over
+# dumb transports.
+#
+# To enable this hook, rename this file to "post-update".
+
+exec git-update-server-info
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-applypatch
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-applypatch b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-applypatch
new file mode 100644
index 0000000..eeccc93
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-applypatch
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# An example hook script to verify what is about to be committed
+# by applypatch from an e-mail message.
+#
+# The hook should exit with non-zero status after issuing an
+# appropriate message if it wants to stop the commit.
+#
+# To enable this hook, make this file executable.
+
+. git-sh-setup
+test -x "$GIT_DIR/hooks/pre-commit" &&
+ exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"}
+:
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-applypatch.sample
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-applypatch.sample b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-applypatch.sample
new file mode 100644
index 0000000..e015e76
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-applypatch.sample
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# An example hook script to verify what is about to be committed
+# by applypatch from an e-mail message.
+#
+# The hook should exit with non-zero status after issuing an
+# appropriate message if it wants to stop the commit.
+#
+# To enable this hook, rename this file to "pre-applypatch".
+
+. git-sh-setup
+test -x "$GIT_DIR/hooks/pre-commit" &&
+ exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"}
+:
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-commit
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-commit b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-commit
new file mode 100644
index 0000000..18b8730
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-commit
@@ -0,0 +1,70 @@
+#!/bin/sh
+#
+# An example hook script to verify what is about to be committed.
+# Called by git-commit with no arguments. The hook should
+# exit with non-zero status after issuing an appropriate message if
+# it wants to stop the commit.
+#
+# To enable this hook, make this file executable.
+
+# This is slightly modified from Andrew Morton's Perfect Patch.
+# Lines you introduce should not have trailing whitespace.
+# Also check for an indentation that has SP before a TAB.
+
+if git-rev-parse --verify HEAD 2>/dev/null
+then
+ git-diff-index -p -M --cached HEAD
+else
+ # NEEDSWORK: we should produce a diff with an empty tree here
+ # if we want to do the same verification for the initial import.
+ :
+fi |
+perl -e '
+ my $found_bad = 0;
+ my $filename;
+ my $reported_filename = "";
+ my $lineno;
+ sub bad_line {
+ my ($why, $line) = @_;
+ if (!$found_bad) {
+ print STDERR "*\n";
+ print STDERR "* You have some suspicious patch lines:\n";
+ print STDERR "*\n";
+ $found_bad = 1;
+ }
+ if ($reported_filename ne $filename) {
+ print STDERR "* In $filename\n";
+ $reported_filename = $filename;
+ }
+ print STDERR "* $why (line $lineno)\n";
+ print STDERR "$filename:$lineno:$line\n";
+ }
+ while (<>) {
+ if (m|^diff --git a/(.*) b/\1$|) {
+ $filename = $1;
+ next;
+ }
+ if (/^@@ -\S+ \+(\d+)/) {
+ $lineno = $1 - 1;
+ next;
+ }
+ if (/^ /) {
+ $lineno++;
+ next;
+ }
+ if (s/^\+//) {
+ $lineno++;
+ chomp;
+ if (/\s$/) {
+ bad_line("trailing whitespace", $_);
+ }
+ if (/^\s* /) {
+ bad_line("indent SP followed by a TAB", $_);
+ }
+ if (/^(?:[<>=]){7}/) {
+ bad_line("unresolved merge conflict", $_);
+ }
+ }
+ }
+ exit($found_bad);
+'
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-commit.sample
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-commit.sample b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-commit.sample
new file mode 100644
index 0000000..829ce59
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-commit.sample
@@ -0,0 +1,18 @@
+#!/bin/sh
+#
+# An example hook script to verify what is about to be committed.
+# Called by git-commit with no arguments. The hook should
+# exit with non-zero status after issuing an appropriate message if
+# it wants to stop the commit.
+#
+# To enable this hook, rename this file to "pre-commit".
+
+if git-rev-parse --verify HEAD 2>/dev/null
+then
+ against=HEAD
+else
+ # Initial commit: diff against an empty tree object
+ against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
+fi
+
+exec git diff-index --check --cached $against --
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-rebase
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-rebase b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-rebase
new file mode 100644
index 0000000..981c454
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-rebase
@@ -0,0 +1,150 @@
+#!/bin/sh
+#
+# Copyright (c) 2006 Junio C Hamano
+#
+
+publish=next
+basebranch="$1"
+if test "$#" = 2
+then
+ topic="refs/heads/$2"
+else
+ topic=`git symbolic-ref HEAD`
+fi
+
+case "$basebranch,$topic" in
+master,refs/heads/??/*)
+ ;;
+*)
+ exit 0 ;# we do not interrupt others.
+ ;;
+esac
+
+# Now we are dealing with a topic branch being rebased
+# on top of master. Is it OK to rebase it?
+
+# Is topic fully merged to master?
+not_in_master=`git-rev-list --pretty=oneline ^master "$topic"`
+if test -z "$not_in_master"
+then
+ echo >&2 "$topic is fully merged to master; better remove it."
+ exit 1 ;# we could allow it, but there is no point.
+fi
+
+# Is topic ever merged to next? If so you should not be rebasing it.
+only_next_1=`git-rev-list ^master "^$topic" ${publish} | sort`
+only_next_2=`git-rev-list ^master ${publish} | sort`
+if test "$only_next_1" = "$only_next_2"
+then
+ not_in_topic=`git-rev-list "^$topic" master`
+ if test -z "$not_in_topic"
+ then
+ echo >&2 "$topic is already up-to-date with master"
+ exit 1 ;# we could allow it, but there is no point.
+ else
+ exit 0
+ fi
+else
+ not_in_next=`git-rev-list --pretty=oneline ^${publish} "$topic"`
+ perl -e '
+ my $topic = $ARGV[0];
+ my $msg = "* $topic has commits already merged to public branch:\n";
+ my (%not_in_next) = map {
+ /^([0-9a-f]+) /;
+ ($1 => 1);
+ } split(/\n/, $ARGV[1]);
+ for my $elem (map {
+ /^([0-9a-f]+) (.*)$/;
+ [$1 => $2];
+ } split(/\n/, $ARGV[2])) {
+ if (!exists $not_in_next{$elem->[0]}) {
+ if ($msg) {
+ print STDERR $msg;
+ undef $msg;
+ }
+ print STDERR " $elem->[1]\n";
+ }
+ }
+ ' "$topic" "$not_in_next" "$not_in_master"
+ exit 1
+fi
+
+exit 0
+
+################################################################
+
+This sample hook safeguards topic branches that have been
+published from being rewound.
+
+The workflow assumed here is:
+
+ * Once a topic branch forks from "master", "master" is never
+ merged into it again (either directly or indirectly).
+
+ * Once a topic branch is fully cooked and merged into "master",
+ it is deleted. If you need to build on top of it to correct
+ earlier mistakes, a new topic branch is created by forking at
+ the tip of the "master". This is not strictly necessary, but
+ it makes it easier to keep your history simple.
+
+ * Whenever you need to test or publish your changes to topic
+ branches, merge them into "next" branch.
+
+The script, being an example, hardcodes the publish branch name
+to be "next", but it is trivial to make it configurable via
+$GIT_DIR/config mechanism.
+
+With this workflow, you would want to know:
+
+(1) ... if a topic branch has ever been merged to "next". Young
+ topic branches can have stupid mistakes you would rather
+ clean up before publishing, and things that have not been
+ merged into other branches can be easily rebased without
+ affecting other people. But once it is published, you would
+ not want to rewind it.
+
+(2) ... if a topic branch has been fully merged to "master".
+ Then you can delete it. More importantly, you should not
+ build on top of it -- other people may already want to
+ change things related to the topic as patches against your
+ "master", so if you need further changes, it is better to
+ fork the topic (perhaps with the same name) afresh from the
+ tip of "master".
+
+Let's look at this example:
+
+ o---o---o---o---o---o---o---o---o---o "next"
+ / / / /
+ / a---a---b A / /
+ / / / /
+ / / c---c---c---c B /
+ / / / \ /
+ / / / b---b C \ /
+ / / / / \ /
+ ---o---o---o---o---o---o---o---o---o---o---o "master"
+
+
+A, B and C are topic branches.
+
+ * A has one fix since it was merged up to "next".
+
+ * B has finished. It has been fully merged up to "master" and "next",
+ and is ready to be deleted.
+
+ * C has not merged to "next" at all.
+
+We would want to allow C to be rebased, refuse A, and encourage
+B to be deleted.
+
+To compute (1):
+
+ git-rev-list ^master ^topic next
+ git-rev-list ^master next
+
+ if these match, topic has not merged in next at all.
+
+To compute (2):
+
+ git-rev-list master..topic
+
+ if this is empty, it is fully merged to "master".
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-rebase.sample
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-rebase.sample b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-rebase.sample
new file mode 100644
index 0000000..f11a987
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/pre-rebase.sample
@@ -0,0 +1,169 @@
+#!/bin/sh
+#
+# Copyright (c) 2006, 2008 Junio C Hamano
+#
+# The "pre-rebase" hook is run just before "git-rebase" starts doing
+# its job, and can prevent the command from running by exiting with
+# non-zero status.
+#
+# The hook is called with the following parameters:
+#
+# $1 -- the upstream the series was forked from.
+# $2 -- the branch being rebased (or empty when rebasing the current branch).
+#
+# This sample shows how to prevent topic branches that are already
+# merged to 'next' branch from getting rebased, because allowing it
+# would result in rebasing already published history.
+
+publish=next
+basebranch="$1"
+if test "$#" = 2
+then
+ topic="refs/heads/$2"
+else
+ topic=`git symbolic-ref HEAD` ||
+ exit 0 ;# we do not interrupt rebasing detached HEAD
+fi
+
+case "$topic" in
+refs/heads/??/*)
+ ;;
+*)
+ exit 0 ;# we do not interrupt others.
+ ;;
+esac
+
+# Now we are dealing with a topic branch being rebased
+# on top of master. Is it OK to rebase it?
+
+# Does the topic really exist?
+git show-ref -q "$topic" || {
+ echo >&2 "No such branch $topic"
+ exit 1
+}
+
+# Is topic fully merged to master?
+not_in_master=`git-rev-list --pretty=oneline ^master "$topic"`
+if test -z "$not_in_master"
+then
+ echo >&2 "$topic is fully merged to master; better remove it."
+ exit 1 ;# we could allow it, but there is no point.
+fi
+
+# Is topic ever merged to next? If so you should not be rebasing it.
+only_next_1=`git-rev-list ^master "^$topic" ${publish} | sort`
+only_next_2=`git-rev-list ^master ${publish} | sort`
+if test "$only_next_1" = "$only_next_2"
+then
+ not_in_topic=`git-rev-list "^$topic" master`
+ if test -z "$not_in_topic"
+ then
+ echo >&2 "$topic is already up-to-date with master"
+ exit 1 ;# we could allow it, but there is no point.
+ else
+ exit 0
+ fi
+else
+ not_in_next=`git-rev-list --pretty=oneline ^${publish} "$topic"`
+ perl -e '
+ my $topic = $ARGV[0];
+ my $msg = "* $topic has commits already merged to public branch:\n";
+ my (%not_in_next) = map {
+ /^([0-9a-f]+) /;
+ ($1 => 1);
+ } split(/\n/, $ARGV[1]);
+ for my $elem (map {
+ /^([0-9a-f]+) (.*)$/;
+ [$1 => $2];
+ } split(/\n/, $ARGV[2])) {
+ if (!exists $not_in_next{$elem->[0]}) {
+ if ($msg) {
+ print STDERR $msg;
+ undef $msg;
+ }
+ print STDERR " $elem->[1]\n";
+ }
+ }
+ ' "$topic" "$not_in_next" "$not_in_master"
+ exit 1
+fi
+
+exit 0
+
+################################################################
+
+This sample hook safeguards topic branches that have been
+published from being rewound.
+
+The workflow assumed here is:
+
+ * Once a topic branch forks from "master", "master" is never
+ merged into it again (either directly or indirectly).
+
+ * Once a topic branch is fully cooked and merged into "master",
+ it is deleted. If you need to build on top of it to correct
+ earlier mistakes, a new topic branch is created by forking at
+ the tip of the "master". This is not strictly necessary, but
+ it makes it easier to keep your history simple.
+
+ * Whenever you need to test or publish your changes to topic
+ branches, merge them into "next" branch.
+
+The script, being an example, hardcodes the publish branch name
+to be "next", but it is trivial to make it configurable via
+$GIT_DIR/config mechanism.
+
+With this workflow, you would want to know:
+
+(1) ... if a topic branch has ever been merged to "next". Young
+ topic branches can have stupid mistakes you would rather
+ clean up before publishing, and things that have not been
+ merged into other branches can be easily rebased without
+ affecting other people. But once it is published, you would
+ not want to rewind it.
+
+(2) ... if a topic branch has been fully merged to "master".
+ Then you can delete it. More importantly, you should not
+ build on top of it -- other people may already want to
+ change things related to the topic as patches against your
+ "master", so if you need further changes, it is better to
+ fork the topic (perhaps with the same name) afresh from the
+ tip of "master".
+
+Let's look at this example:
+
+ o---o---o---o---o---o---o---o---o---o "next"
+ / / / /
+ / a---a---b A / /
+ / / / /
+ / / c---c---c---c B /
+ / / / \ /
+ / / / b---b C \ /
+ / / / / \ /
+ ---o---o---o---o---o---o---o---o---o---o---o "master"
+
+
+A, B and C are topic branches.
+
+ * A has one fix since it was merged up to "next".
+
+ * B has finished. It has been fully merged up to "master" and "next",
+ and is ready to be deleted.
+
+ * C has not merged to "next" at all.
+
+We would want to allow C to be rebased, refuse A, and encourage
+B to be deleted.
+
+To compute (1):
+
+ git-rev-list ^master ^topic next
+ git-rev-list ^master next
+
+ if these match, topic has not merged in next at all.
+
+To compute (2):
+
+ git-rev-list master..topic
+
+ if this is empty, it is fully merged to "master".
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/prepare-commit-msg.sample
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/prepare-commit-msg.sample b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/prepare-commit-msg.sample
new file mode 100644
index 0000000..f092240
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/prepare-commit-msg.sample
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# An example hook script to prepare the commit log message.
+# Called by git-commit with the name of the file that has the
+# commit message, followed by the description of the commit
+# message's source. The hook's purpose is to edit the commit
+# message file. If the hook fails with a non-zero status,
+# the commit is aborted.
+#
+# To enable this hook, rename this file to "prepare-commit-msg".
+
+# This hook includes three examples. The first comments out the
+# "Conflicts:" part of a merge commit.
+#
+# The second includes the output of "git diff --name-status -r"
+# into the message, just before the "git status" output. It is
+# commented because it doesn't cope with --amend or with squashed
+# commits.
+#
+# The third example adds a Signed-off-by line to the message, that can
+# still be edited. This is rarely a good idea.
+
+case "$2,$3" in
+ merge,)
+ perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;;
+
+# ,|template,)
+# perl -i.bak -pe '
+# print "\n" . `git diff --cached --name-status -r`
+# if /^#/ && $first++ == 0' "$1" ;;
+
+ *) ;;
+esac
+
+# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
+# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/update
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/update b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/update
new file mode 100644
index 0000000..d8c7626
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/update
@@ -0,0 +1,78 @@
+#!/bin/sh
+#
+# An example hook script to blocks unannotated tags from entering.
+# Called by git-receive-pack with arguments: refname sha1-old sha1-new
+#
+# To enable this hook, make this file executable by "chmod +x update".
+#
+# Config
+# ------
+# hooks.allowunannotated
+# This boolean sets whether unannotated tags will be allowed into the
+# repository. By default they won't be.
+#
+
+# --- Command line
+refname="$1"
+oldrev="$2"
+newrev="$3"
+
+# --- Safety check
+if [ -z "$GIT_DIR" ]; then
+ echo "Don't run this script from the command line." >&2
+ echo " (if you want, you could supply GIT_DIR then run" >&2
+ echo " $0 <ref> <oldrev> <newrev>)" >&2
+ exit 1
+fi
+
+if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
+ echo "Usage: $0 <ref> <oldrev> <newrev>" >&2
+ exit 1
+fi
+
+# --- Config
+allowunannotated=$(git-repo-config --bool hooks.allowunannotated)
+
+# check for no description
+projectdesc=$(sed -e '1p' "$GIT_DIR/description")
+if [ -z "$projectdesc" -o "$projectdesc" = "Unnamed repository; edit this file to name it for gitweb" ]; then
+ echo "*** Project description file hasn't been set" >&2
+ exit 1
+fi
+
+# --- Check types
+# if $newrev is 0000...0000, it's a commit to delete a branch
+if [ "$newrev" = "0000000000000000000000000000000000000000" ]; then
+ newrev_type=commit
+else
+ newrev_type=$(git-cat-file -t $newrev)
+fi
+
+case "$refname","$newrev_type" in
+ refs/tags/*,commit)
+ # un-annotated tag
+ short_refname=${refname##refs/tags/}
+ if [ "$allowunannotated" != "true" ]; then
+ echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2
+ echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2
+ exit 1
+ fi
+ ;;
+ refs/tags/*,tag)
+ # annotated tag
+ ;;
+ refs/heads/*,commit)
+ # branch
+ ;;
+ refs/remotes/*,commit)
+ # tracking branch
+ ;;
+ *)
+ # Anything else (is there anything else?)
+ echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2
+ exit 1
+ ;;
+esac
+
+# --- Finished
+exit 0
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/update.sample
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/update.sample b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/update.sample
new file mode 100644
index 0000000..51a2faf
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/hooks/update.sample
@@ -0,0 +1,107 @@
+#!/bin/sh
+#
+# An example hook script to blocks unannotated tags from entering.
+# Called by git-receive-pack with arguments: refname sha1-old sha1-new
+#
+# To enable this hook, rename this file to "update".
+#
+# Config
+# ------
+# hooks.allowunannotated
+# This boolean sets whether unannotated tags will be allowed into the
+# repository. By default they won't be.
+# hooks.allowdeletetag
+# This boolean sets whether deleting tags will be allowed in the
+# repository. By default they won't be.
+# hooks.allowdeletebranch
+# This boolean sets whether deleting branches will be allowed in the
+# repository. By default they won't be.
+#
+
+# --- Command line
+refname="$1"
+oldrev="$2"
+newrev="$3"
+
+# --- Safety check
+if [ -z "$GIT_DIR" ]; then
+ echo "Don't run this script from the command line." >&2
+ echo " (if you want, you could supply GIT_DIR then run" >&2
+ echo " $0 <ref> <oldrev> <newrev>)" >&2
+ exit 1
+fi
+
+if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
+ echo "Usage: $0 <ref> <oldrev> <newrev>" >&2
+ exit 1
+fi
+
+# --- Config
+allowunannotated=$(git config --bool hooks.allowunannotated)
+allowdeletebranch=$(git config --bool hooks.allowdeletebranch)
+allowdeletetag=$(git config --bool hooks.allowdeletetag)
+
+# check for no description
+projectdesc=$(sed -e '1q' "$GIT_DIR/description")
+if [ -z "$projectdesc" -o "$projectdesc" = "Unnamed repository; edit this file to name it for gitweb." ]; then
+ echo "*** Project description file hasn't been set" >&2
+ exit 1
+fi
+
+# --- Check types
+# if $newrev is 0000...0000, it's a commit to delete a ref.
+if [ "$newrev" = "0000000000000000000000000000000000000000" ]; then
+ newrev_type=delete
+else
+ newrev_type=$(git-cat-file -t $newrev)
+fi
+
+case "$refname","$newrev_type" in
+ refs/tags/*,commit)
+ # un-annotated tag
+ short_refname=${refname##refs/tags/}
+ if [ "$allowunannotated" != "true" ]; then
+ echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2
+ echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2
+ exit 1
+ fi
+ ;;
+ refs/tags/*,delete)
+ # delete tag
+ if [ "$allowdeletetag" != "true" ]; then
+ echo "*** Deleting a tag is not allowed in this repository" >&2
+ exit 1
+ fi
+ ;;
+ refs/tags/*,tag)
+ # annotated tag
+ ;;
+ refs/heads/*,commit)
+ # branch
+ ;;
+ refs/heads/*,delete)
+ # delete branch
+ if [ "$allowdeletebranch" != "true" ]; then
+ echo "*** Deleting a branch is not allowed in this repository" >&2
+ exit 1
+ fi
+ ;;
+ refs/remotes/*,commit)
+ # tracking branch
+ ;;
+ refs/remotes/*,delete)
+ # delete tracking branch
+ if [ "$allowdeletebranch" != "true" ]; then
+ echo "*** Deleting a tracking branch is not allowed in this repository" >&2
+ exit 1
+ fi
+ ;;
+ *)
+ # Anything else (is there anything else?)
+ echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2
+ exit 1
+ ;;
+esac
+
+# --- Finished
+exit 0
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/info/exclude
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/info/exclude b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/info/exclude
new file mode 100644
index 0000000..ebd4444
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/info/exclude
@@ -0,0 +1,6 @@
+# git-ls-files --others --exclude-from=.git/info/exclude
+# Lines that start with '#' are comments.
+# For a project mostly in C, the following would be a good set of
+# exclude patterns (uncomment them if you want to use them):
+# *.[oa]
+# *~
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/logs/HEAD
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/logs/HEAD b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/logs/HEAD
new file mode 100644
index 0000000..3cf80ca
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/logs/HEAD
@@ -0,0 +1,3 @@
+0000000000000000000000000000000000000000 c51dcd33e7b71897603c203b5e0afc1d75f70051 Mark Struberg <st...@yahoo.de> 1196106917 +0100
+c51dcd33e7b71897603c203b5e0afc1d75f70051 baa229a9193371fad604444f64c4f26f8ff702f3 Mark Struberg <st...@yahoo.de> 1197041894 +0100 push
+baa229a9193371fad604444f64c4f26f8ff702f3 1d308c3b92eb0df9c0dc76436d50edfd0ca41d18 Mark Struberg <st...@yahoo.de> 1197042012 +0100 push
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/logs/refs/heads/master
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/logs/refs/heads/master b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/logs/refs/heads/master
new file mode 100644
index 0000000..3cf80ca
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/logs/refs/heads/master
@@ -0,0 +1,3 @@
+0000000000000000000000000000000000000000 c51dcd33e7b71897603c203b5e0afc1d75f70051 Mark Struberg <st...@yahoo.de> 1196106917 +0100
+c51dcd33e7b71897603c203b5e0afc1d75f70051 baa229a9193371fad604444f64c4f26f8ff702f3 Mark Struberg <st...@yahoo.de> 1197041894 +0100 push
+baa229a9193371fad604444f64c4f26f8ff702f3 1d308c3b92eb0df9c0dc76436d50edfd0ca41d18 Mark Struberg <st...@yahoo.de> 1197042012 +0100 push
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/logs/refs/remotes/origin/master
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/logs/refs/remotes/origin/master b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/logs/refs/remotes/origin/master
new file mode 100644
index 0000000..6cb21b1
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/logs/refs/remotes/origin/master
@@ -0,0 +1 @@
+0000000000000000000000000000000000000000 c51dcd33e7b71897603c203b5e0afc1d75f70051 Mark Struberg <st...@yahoo.de> 1196106917 +0100 clone: from /home/msx/tmp/maven-git/repository/.git
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/17/e953589369a48dcb0a0cbad084a76ef852cd11
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/17/e953589369a48dcb0a0cbad084a76ef852cd11 b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/17/e953589369a48dcb0a0cbad084a76ef852cd11
new file mode 100644
index 0000000..4c7bbd6
Binary files /dev/null and b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/17/e953589369a48dcb0a0cbad084a76ef852cd11 differ
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/1d/308c3b92eb0df9c0dc76436d50edfd0ca41d18
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/1d/308c3b92eb0df9c0dc76436d50edfd0ca41d18 b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/1d/308c3b92eb0df9c0dc76436d50edfd0ca41d18
new file mode 100644
index 0000000..7d4c247
Binary files /dev/null and b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/1d/308c3b92eb0df9c0dc76436d50edfd0ca41d18 differ
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/3b/459fa9451a94fc1acd10e2e29ab73d93eb816d
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/3b/459fa9451a94fc1acd10e2e29ab73d93eb816d b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/3b/459fa9451a94fc1acd10e2e29ab73d93eb816d
new file mode 100644
index 0000000..6b6bfad
Binary files /dev/null and b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/3b/459fa9451a94fc1acd10e2e29ab73d93eb816d differ
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/3b/d305c57c635aead10cf59f7c1dc51af03edaf7
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/3b/d305c57c635aead10cf59f7c1dc51af03edaf7 b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/3b/d305c57c635aead10cf59f7c1dc51af03edaf7
new file mode 100644
index 0000000..0a079e7
Binary files /dev/null and b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/3b/d305c57c635aead10cf59f7c1dc51af03edaf7 differ
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/3c/f7bb86c15554148bf5b0b12bfd639e54a77e58
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/3c/f7bb86c15554148bf5b0b12bfd639e54a77e58 b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/3c/f7bb86c15554148bf5b0b12bfd639e54a77e58
new file mode 100644
index 0000000..c8859bd
Binary files /dev/null and b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/3c/f7bb86c15554148bf5b0b12bfd639e54a77e58 differ
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/61/4a3fd04313593d67f4154855a06941046326b3
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/61/4a3fd04313593d67f4154855a06941046326b3 b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/61/4a3fd04313593d67f4154855a06941046326b3
new file mode 100644
index 0000000..bca48ac
Binary files /dev/null and b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/61/4a3fd04313593d67f4154855a06941046326b3 differ
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/61/a0d22b023d6e31894d736cca8c1a47b6edd822
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/61/a0d22b023d6e31894d736cca8c1a47b6edd822 b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/61/a0d22b023d6e31894d736cca8c1a47b6edd822
new file mode 100644
index 0000000..26470db
Binary files /dev/null and b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/61/a0d22b023d6e31894d736cca8c1a47b6edd822 differ
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/92/09a983605d6e43e5cf841a1ea18a1914bb7407
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/92/09a983605d6e43e5cf841a1ea18a1914bb7407 b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/92/09a983605d6e43e5cf841a1ea18a1914bb7407
new file mode 100644
index 0000000..9493985
Binary files /dev/null and b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/92/09a983605d6e43e5cf841a1ea18a1914bb7407 differ
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/92/f139dfec4d1dfb79c3cd2f94e83bf13129668b
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/92/f139dfec4d1dfb79c3cd2f94e83bf13129668b b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/92/f139dfec4d1dfb79c3cd2f94e83bf13129668b
new file mode 100644
index 0000000..a352d5a
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/92/f139dfec4d1dfb79c3cd2f94e83bf13129668b
@@ -0,0 +1 @@
+x��1�0@Q��;��� !.�� \ǡ�A��=�ly�R��@k����1H�������p�Q(I ��5q��W�j��;\����_�:�y�u����H=}[$D'ߥ�_ؕ�X���Y����<m
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/94/d3d586e355f318d67e3da6bb16a91be7aad1a7
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/94/d3d586e355f318d67e3da6bb16a91be7aad1a7 b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/94/d3d586e355f318d67e3da6bb16a91be7aad1a7
new file mode 100644
index 0000000..ea35629
Binary files /dev/null and b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/94/d3d586e355f318d67e3da6bb16a91be7aad1a7 differ
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/9e/131cfc732b0d9f42b9b712a528d0632d9bcca7
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/9e/131cfc732b0d9f42b9b712a528d0632d9bcca7 b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/9e/131cfc732b0d9f42b9b712a528d0632d9bcca7
new file mode 100644
index 0000000..0ba67da
Binary files /dev/null and b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/9e/131cfc732b0d9f42b9b712a528d0632d9bcca7 differ
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/b5/3306f849b69ef0459ddf5cccff06b5fbb08c23
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/b5/3306f849b69ef0459ddf5cccff06b5fbb08c23 b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/b5/3306f849b69ef0459ddf5cccff06b5fbb08c23
new file mode 100644
index 0000000..314330e
Binary files /dev/null and b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/b5/3306f849b69ef0459ddf5cccff06b5fbb08c23 differ
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/ba/a229a9193371fad604444f64c4f26f8ff702f3
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/ba/a229a9193371fad604444f64c4f26f8ff702f3 b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/ba/a229a9193371fad604444f64c4f26f8ff702f3
new file mode 100644
index 0000000..e94938a
--- /dev/null
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/ba/a229a9193371fad604444f64c4f26f8ff702f3
@@ -0,0 +1 @@
+x��MN1@a�9����O���XqDZ��ʤ nB����<�~��|��9T�I�K��������ENV��� F��w��IԤ���f*K>b��&E6���e�D������x��9�U����:}����/@�d�TJ���_��͎[��~�}����Ƕ���}���jP�
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/maven-scm/blob/e86351f4/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/ba/cd4ee105073117b30e5dcdba5150373b6b53c6
----------------------------------------------------------------------
diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/ba/cd4ee105073117b30e5dcdba5150373b6b53c6 b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/ba/cd4ee105073117b30e5dcdba5150373b6b53c6
new file mode 100644
index 0000000..fe99cd8
Binary files /dev/null and b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/test/resources/repository/objects/ba/cd4ee105073117b30e5dcdba5150373b6b53c6 differ