Merge "IndexDiff: support state [removed, untracked]"
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java
index b1c8254..5fb4a96 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java
@@ -150,7 +150,7 @@ protected void run() throws Exception {
startBranch = startRef.getName();
else
startBranch = startAt.name();
- startBranch = db.shortenRefName(startBranch);
+ startBranch = Repository.shortenRefName(startBranch);
String newRefName = newHead;
if (!newRefName.startsWith(Constants.R_HEADS))
newRefName = Constants.R_HEADS + newRefName;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefRename.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefRename.java
index 2ff5c61..3cfb75a 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefRename.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefRename.java
@@ -77,14 +77,13 @@ protected RefRename(final RefUpdate src, final RefUpdate dst) {
source = src;
destination = dst;
- Repository repo = destination.getRepository();
String cmd = "";
if (source.getName().startsWith(Constants.R_HEADS)
&& destination.getName().startsWith(Constants.R_HEADS))
cmd = "Branch: ";
setRefLogMessage(cmd + "renamed "
- + repo.shortenRefName(source.getName()) + " to "
- + repo.shortenRefName(destination.getName()));
+ + Repository.shortenRefName(source.getName()) + " to "
+ + Repository.shortenRefName(destination.getName()));
}
/** @return identity of the user making the change in the reflog. */
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
index 5c8b15f..8ba6ba5 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
@@ -1119,7 +1119,7 @@ public File getWorkTree() throws NoWorkTreeException {
*
* @return a more user friendly ref name
*/
- public String shortenRefName(String refName) {
+ public static String shortenRefName(String refName) {
if (refName.startsWith(Constants.R_HEADS))
return refName.substring(Constants.R_HEADS.length());
if (refName.startsWith(Constants.R_TAGS))