The method has no reason to be non-static. Change-Id: I1c09e074395d49cee0e6e53679b499d1f0c351eatags/v0.10.1
@@ -150,7 +150,7 @@ class Branch extends TextBuiltin { | |||
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; |
@@ -77,14 +77,13 @@ public abstract class RefRename { | |||
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. */ |
@@ -1119,7 +1119,7 @@ public abstract class Repository { | |||
* | |||
* @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)) |