]> source.dussan.org Git - jgit.git/commitdiff
Make Repository.shortenRefName static 59/1859/1
authorRobin Stocker <robin@nibor.org>
Sat, 6 Nov 2010 12:41:06 +0000 (13:41 +0100)
committerRobin Stocker <robin@nibor.org>
Sat, 6 Nov 2010 12:41:06 +0000 (13:41 +0100)
The method has no reason to be non-static.

Change-Id: I1c09e074395d49cee0e6e53679b499d1f0c351ea

org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/RefRename.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java

index b1c8254626093586658456feb2bcd4e1b6564433..5fb4a963e180a8af4c80033099d90e62d6ef3c6e 100644 (file)
@@ -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;
index 2ff5c614b5995bf76e08d9d9d0eec0a867f53c03..3cfb75a6091031d66b4255890820181f286dc68a 100644 (file)
@@ -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. */
index 5c8b15f5a6c5ae006a5a46637b9e05978dfb06be..8ba6ba5b99e06ac3656ae5a1cb5faa99c38acdcc 100644 (file)
@@ -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))