diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2010-09-03 12:59:53 -0700 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2010-09-03 12:59:53 -0700 |
commit | 34a755f1df959bd34f9426143765e650665b1afb (patch) | |
tree | cd39835daf6b3d4a47e383b0a02687a67521a13e /org.eclipse.jgit | |
parent | 33837e44c3ba6417cfd0fa52103bd1687dfcdfd8 (diff) | |
download | jgit-34a755f1df959bd34f9426143765e650665b1afb.tar.gz jgit-34a755f1df959bd34f9426143765e650665b1afb.zip |
Remove costly quoting test in DiffFormatter
QuotedString.GIT_PATH returns the input reference exactly if
the string does not require quoting, otherwise it returns a
copy that contains the quotes on either end, plus escapes in
the middle where necessary to meet conventions.
Testing the return against '"' + name + '"' is always false,
because GIT_PATH will never return it that way. The only way
we have quotes on either end is if there is an escape in the
middle, in which case the string isn't equal anyway.
Change-Id: I4d21d8e5c7da0d7df9792c01ce719548fa2df16b
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java index dfd399dc43..8e92c8995c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java @@ -600,8 +600,7 @@ public class DiffFormatter { } private static String quotePath(String name) { - String q = QuotedString.GIT_PATH.quote(name); - return ('"' + name + '"').equals(q) ? name : q; + return QuotedString.GIT_PATH.quote(name); } /** |