Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Stocker2010-11-06 12:41:06 +0000
committerRobin Stocker2010-11-06 12:41:06 +0000
commit2fb0f5cfc067cb20f178cf4db7395b394b48783b (patch)
tree0e1faeee3fb76feac0bedce9ea68fdccbfd5182a
parentd1e8e97316f8a1349e69a773b1fb0837d9892bbd (diff)
downloadegit-2fb0f5cfc067cb20f178cf4db7395b394b48783b.tar.gz
egit-2fb0f5cfc067cb20f178cf4db7395b394b48783b.tar.xz
egit-2fb0f5cfc067cb20f178cf4db7395b394b48783b.zip
Make Repository.shortenRefName static
The method has no reason to be non-static. Change-Id: I1c09e074395d49cee0e6e53679b499d1f0c351ea
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/RefRename.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java2
3 files changed, 4 insertions, 5 deletions
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 b1c8254626..5fb4a963e1 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 @@ 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;
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 2ff5c614b5..3cfb75a609 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 @@ 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. */
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 5c8b15f5a6..8ba6ba5b99 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 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))

Back to the top