Enhance special filename sorting
Previously, filenames were directly locale compared, which caused some instances of sorting to occur incorrectly (e.g. sorting task.go after task_test.go). The new behavior is to compare the filenames first, and then compare the filename with extension iff the filenames are equal. Bug: Issue 4545 Change-Id: I9fe5a5b111c8ae9b4dc587b97753aa6aa11224ef
This commit is contained in:
@@ -139,8 +139,8 @@
|
||||
} else {
|
||||
target.blur();
|
||||
}
|
||||
// @see Issue 4255.
|
||||
if (this._inputVal) {
|
||||
// @see Issue 4255.
|
||||
page.show('/q/' +
|
||||
encodeURIComponent(encodeURIComponent(this._inputVal)));
|
||||
}
|
||||
|
||||
@@ -442,8 +442,7 @@
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return a.localeCompare(b);
|
||||
return aFile.localeCompare(bFile) || a.localeCompare(b);
|
||||
},
|
||||
|
||||
getChangeRevisionActions: function(changeNum, patchNum) {
|
||||
|
||||
@@ -252,6 +252,17 @@ limitations under the License.
|
||||
'minidump/minidump_thread_writer.h',
|
||||
'minidump/minidump_thread_writer.cc',
|
||||
]);
|
||||
|
||||
// Regression test for Issue 4545.
|
||||
assert.deepEqual([
|
||||
'task_test.go',
|
||||
'task.go',
|
||||
]
|
||||
.sort(element._specialFilePathCompare),
|
||||
[
|
||||
'task.go',
|
||||
'task_test.go',
|
||||
]);
|
||||
});
|
||||
|
||||
test('rebase always enabled', function(done) {
|
||||
|
||||
Reference in New Issue
Block a user