Merge "Properly encode file path in diff view"
This commit is contained in:
commit
0340226dd9
@ -16,6 +16,7 @@ limitations under the License.
|
||||
|
||||
<link rel="import" href="../../../bower_components/polymer/polymer.html">
|
||||
<link rel="import" href="../../../bower_components/iron-dropdown/iron-dropdown.html">
|
||||
<link rel="import" href="../../../behaviors/gr-url-encoding-behavior.html">
|
||||
<link rel="import" href="../../../behaviors/keyboard-shortcut-behavior.html">
|
||||
<link rel="import" href="../../../behaviors/rest-client-behavior.html">
|
||||
<link rel="import" href="../../shared/gr-button/gr-button.html">
|
||||
|
@ -92,6 +92,7 @@
|
||||
behaviors: [
|
||||
Gerrit.KeyboardShortcutBehavior,
|
||||
Gerrit.RESTClientBehavior,
|
||||
Gerrit.URLEncodingBehavior,
|
||||
],
|
||||
|
||||
observers: [
|
||||
@ -389,7 +390,7 @@
|
||||
|
||||
_getDiffURL: function(changeNum, patchRange, path) {
|
||||
return '/c/' + changeNum + '/' + this._patchRangeStr(patchRange) + '/' +
|
||||
path;
|
||||
this.encodeURL(path, true);
|
||||
},
|
||||
|
||||
_computeDiffURL: function(changeNum, patchRangeRecord, path) {
|
||||
|
@ -590,5 +590,13 @@ limitations under the License.
|
||||
|
||||
assert.isTrue(replaceStateStub.called);
|
||||
});
|
||||
|
||||
test('_getDiffURL encodes special characters', function() {
|
||||
var changeNum = 123;
|
||||
var patchRange = {basePatchNum: 123, patchNum: 456};
|
||||
var path = 'c++/cpp.cpp';
|
||||
assert.equal(element._getDiffURL(changeNum, patchRange, path),
|
||||
'/c/123/123..456/c%252B%252B/cpp.cpp');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user