diff options
author | Shawn Pearce <spearce@spearce.org> | 2010-11-08 17:42:21 -0500 |
---|---|---|
committer | Code Review <codereview-daemon@eclipse.org> | 2010-11-08 17:42:21 -0500 |
commit | 09555c98535655a8af3ff2b364250130395ecca3 (patch) | |
tree | 660a3ebbbdab86e39baed704e9c38cdffcb497d8 /org.eclipse.jgit | |
parent | a28f33fa8cf93e82b113fb303dfb4955a92b8956 (diff) | |
parent | 2fb0f5cfc067cb20f178cf4db7395b394b48783b (diff) | |
download | jgit-09555c98535655a8af3ff2b364250130395ecca3.tar.gz jgit-09555c98535655a8af3ff2b364250130395ecca3.zip |
Merge "Make Repository.shortenRefName static"
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/RefRename.java | 5 | ||||
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java | 2 |
2 files changed, 3 insertions, 4 deletions
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)) |