Browse Source

DirCacheEditor: Cleanup DeleteTree constructor

Neaten up formatting and avoid strings, which prevents the need for
NLS comment tags.  Instead check the last character using char
literal, and append a char literal instead of a string.

Change-Id: Ib68e017769a1f5c03200354a805769d585a48c8b
stable-4.3
Shawn Pearce 9 years ago
parent
commit
ef757a7e12
  1. 9
      org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java

9
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java vendored

@ -274,10 +274,11 @@ public class DirCacheEditor extends BaseDirCacheEditor {
* only the subtree's contents are matched by the command. * only the subtree's contents are matched by the command.
* The special case "" (not "/"!) deletes all entries. * The special case "" (not "/"!) deletes all entries.
*/ */
public DeleteTree(final String entryPath) { public DeleteTree(String entryPath) {
super( super(entryPath.isEmpty()
(entryPath.endsWith("/") || entryPath.length() == 0) ? entryPath //$NON-NLS-1$ || entryPath.charAt(entryPath.length() - 1) == '/'
: entryPath + "/"); //$NON-NLS-1$ ? entryPath
: entryPath + '/');
} }
public void apply(final DirCacheEntry ent) { public void apply(final DirCacheEntry ent) {

Loading…
Cancel
Save