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
tags/v4.2.0.201601211800-r
Shawn Pearce 8 years ago
parent
commit
ef757a7e12

+ 5
- 4
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java View File

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

public void apply(final DirCacheEntry ent) {

Loading…
Cancel
Save