fix bug with git repositories without head

This commit is contained in:
Sebastian Sdorra
2011-10-03 16:56:28 +02:00
parent 4bba44d710
commit 475f1a67a0

View File

@@ -35,6 +35,7 @@ package sonia.scm.repository;
//~--- non-JDK imports --------------------------------------------------------
import org.eclipse.jgit.diff.DiffFormatter;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Ref;
@@ -55,7 +56,6 @@ import java.io.File;
import java.io.IOException;
import java.util.Map;
import org.eclipse.jgit.diff.DiffFormatter;
/**
*
@@ -94,12 +94,6 @@ public class GitUtil
repo.close();
}
}
public static void release(DiffFormatter formatter){
if ( formatter != null ){
formatter.release();
}
}
/**
* Method description
@@ -118,6 +112,20 @@ public class GitUtil
FS.DETECTED), true);
}
/**
* Method description
*
*
* @param formatter
*/
public static void release(DiffFormatter formatter)
{
if (formatter != null)
{
formatter.release();
}
}
/**
* Method description
*
@@ -233,7 +241,7 @@ public class GitUtil
}
else
{
revId = repo.resolve(Constants.HEAD);
revId = getRepositoryHead(repo);
}
return revId;