mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-02 19:45:51 +01:00
do not strip git ids
This commit is contained in:
@@ -84,10 +84,9 @@ public class GitChangesetConverter implements Closeable
|
||||
* @param repository
|
||||
* @param idLength
|
||||
*/
|
||||
public GitChangesetConverter(org.eclipse.jgit.lib.Repository repository,
|
||||
int idLength)
|
||||
public GitChangesetConverter(org.eclipse.jgit.lib.Repository repository)
|
||||
{
|
||||
this(repository, null, idLength);
|
||||
this(repository, null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,7 +98,7 @@ public class GitChangesetConverter implements Closeable
|
||||
* @param idLength
|
||||
*/
|
||||
public GitChangesetConverter(org.eclipse.jgit.lib.Repository repository,
|
||||
RevWalk revWalk, int idLength)
|
||||
RevWalk revWalk)
|
||||
{
|
||||
this.repository = repository;
|
||||
|
||||
@@ -113,7 +112,6 @@ public class GitChangesetConverter implements Closeable
|
||||
this.revWalk = new RevWalk(repository);
|
||||
}
|
||||
|
||||
this.idLength = idLength;
|
||||
this.tags = GitUtil.createTagMap(repository, revWalk);
|
||||
treeWalk = new TreeWalk(repository);
|
||||
}
|
||||
@@ -143,7 +141,7 @@ public class GitChangesetConverter implements Closeable
|
||||
*/
|
||||
public Changeset createChangeset(RevCommit commit) throws IOException
|
||||
{
|
||||
String id = commit.getId().abbreviate(idLength).name();
|
||||
String id = commit.getId().name();
|
||||
List<String> parentList = null;
|
||||
RevCommit[] parents = commit.getParents();
|
||||
|
||||
@@ -153,7 +151,7 @@ public class GitChangesetConverter implements Closeable
|
||||
|
||||
for (RevCommit parent : parents)
|
||||
{
|
||||
parentList.add(parent.getId().abbreviate(idLength).name());
|
||||
parentList.add(parent.getId().name());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,9 +305,6 @@ public class GitChangesetConverter implements Closeable
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
private int idLength;
|
||||
|
||||
/** Field description */
|
||||
private org.eclipse.jgit.lib.Repository repository;
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ public class GitChangesetViewer implements ChangesetViewer
|
||||
|
||||
if (commit != null)
|
||||
{
|
||||
converter = new GitChangesetConverter(gr, revWalk, GitUtil.ID_LENGTH);
|
||||
converter = new GitChangesetConverter(gr, revWalk);
|
||||
changeset = converter.createChangeset(commit);
|
||||
}
|
||||
else if (logger.isWarnEnabled())
|
||||
@@ -169,7 +169,7 @@ public class GitChangesetViewer implements ChangesetViewer
|
||||
|
||||
if (!gr.getAllRefs().isEmpty())
|
||||
{
|
||||
converter = new GitChangesetConverter(gr, GitUtil.ID_LENGTH);
|
||||
converter = new GitChangesetConverter(gr);
|
||||
|
||||
Git git = new Git(gr);
|
||||
ObjectId headId = GitUtil.getRepositoryHead(gr);
|
||||
@@ -253,7 +253,7 @@ public class GitChangesetViewer implements ChangesetViewer
|
||||
|
||||
if (!gr.getAllRefs().isEmpty())
|
||||
{
|
||||
converter = new GitChangesetConverter(gr, GitUtil.ID_LENGTH);
|
||||
converter = new GitChangesetConverter(gr);
|
||||
|
||||
Git git = new Git(gr);
|
||||
ObjectId revisionId = GitUtil.getRevisionId(gr, revision);
|
||||
|
||||
@@ -141,7 +141,7 @@ public class GitRepositoryHookEvent extends AbstractRepositoryHookEvent
|
||||
try
|
||||
{
|
||||
repository = GitUtil.open(directory);
|
||||
converter = new GitChangesetConverter(repository, GitUtil.ID_LENGTH);
|
||||
converter = new GitChangesetConverter(repository);
|
||||
walk = new RevWalk(repository);
|
||||
walk.reset();
|
||||
walk.sort(RevSort.NONE);
|
||||
|
||||
@@ -66,9 +66,6 @@ import java.util.Map;
|
||||
public class GitUtil
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
public static final int ID_LENGTH = 20;
|
||||
|
||||
/** Field description */
|
||||
public static final String REF_HEAD = "HEAD";
|
||||
|
||||
|
||||
@@ -60,7 +60,6 @@ import sonia.scm.util.IOUtil;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@@ -128,7 +127,7 @@ public class GitLogCommand extends AbstractGitCommand implements LogCommand
|
||||
|
||||
if (commit != null)
|
||||
{
|
||||
converter = new GitChangesetConverter(gr, revWalk, GitUtil.ID_LENGTH);
|
||||
converter = new GitChangesetConverter(gr, revWalk);
|
||||
changeset = converter.createChangeset(commit);
|
||||
}
|
||||
else if (logger.isWarnEnabled())
|
||||
@@ -210,7 +209,7 @@ public class GitLogCommand extends AbstractGitCommand implements LogCommand
|
||||
|
||||
RevWalk revWalk = new RevWalk(gr);
|
||||
|
||||
converter = new GitChangesetConverter(gr, revWalk, GitUtil.ID_LENGTH);
|
||||
converter = new GitChangesetConverter(gr, revWalk);
|
||||
|
||||
if (!Strings.isNullOrEmpty(request.getPath()))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user