Fixed the blob editor deleting all content for files
This only happens for files that the path consists of only numbers Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/58578
This commit is contained in:
parent
45b3c5420c
commit
6a3a28bfde
|
@ -13,7 +13,7 @@ export default () => {
|
|||
if (editBlobForm.length) {
|
||||
const urlRoot = editBlobForm.data('relativeUrlRoot');
|
||||
const assetsPath = editBlobForm.data('assetsPrefix');
|
||||
const filePath = editBlobForm.data('blobFilename');
|
||||
const filePath = `${editBlobForm.data('blobFilename')}`;
|
||||
const currentAction = $('.js-file-title').data('currentAction');
|
||||
const projectId = editBlobForm.data('project-id');
|
||||
const isMarkdown = editBlobForm.data('is-markdown');
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Fixed blob editor deleting file content for certain file paths
|
||||
merge_request:
|
||||
author:
|
||||
type: fixed
|
|
@ -49,6 +49,15 @@ describe 'Editing file blob', :js do
|
|||
end
|
||||
end
|
||||
|
||||
it 'updates the content of file with a number as file path' do
|
||||
project.repository.create_file(user, '1', 'test', message: 'testing', branch_name: branch)
|
||||
visit project_blob_path(project, tree_join(branch, '1'))
|
||||
|
||||
edit_and_commit
|
||||
|
||||
expect(page).to have_content 'NextFeature'
|
||||
end
|
||||
|
||||
context 'from blob file path' do
|
||||
before do
|
||||
visit project_blob_path(project, tree_join(branch, file_path))
|
||||
|
|
Loading…
Reference in New Issue