Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1ff2ac38
Commit
1ff2ac38
authored
Mar 02, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed IDE changed files not reseting after commit
Closes #5094
parent
fa2c63ea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
ee/app/assets/javascripts/ide/stores/modules/commit/actions.js
...p/assets/javascripts/ide/stores/modules/commit/actions.js
+2
-0
spec/javascripts/ide/stores/modules/commit/actions_spec.js
spec/javascripts/ide/stores/modules/commit/actions_spec.js
+20
-2
No files found.
ee/app/assets/javascripts/ide/stores/modules/commit/actions.js
View file @
1ff2ac38
...
...
@@ -94,6 +94,8 @@ export const updateFilesAfterCommit = (
raw
:
entry
.
content
,
},
{
root
:
true
});
commit
(
rootTypes
.
DISCARD_FILE_CHANGES
,
entry
,
{
root
:
true
});
eventHub
.
$emit
(
`editor.update.model.content.
${
entry
.
path
}
`
,
entry
.
raw
);
});
...
...
spec/javascripts/ide/stores/modules/commit/actions_spec.js
View file @
1ff2ac38
...
...
@@ -178,6 +178,7 @@ describe('IDE commit module actions', () => {
f
=
file
(
'
changedFile
'
);
Object
.
assign
(
f
,
{
active
:
true
,
changed
:
true
,
content
:
'
file content
'
,
});
...
...
@@ -191,8 +192,11 @@ describe('IDE commit module actions', () => {
},
},
};
store
.
state
.
changedFiles
.
push
(
f
);
store
.
state
.
openFiles
.
push
(
f
);
store
.
state
.
changedFiles
.
push
(
f
,
{
...
file
(
'
changedFile2
'
),
changed
:
true
,
});
store
.
state
.
openFiles
=
store
.
state
.
changedFiles
;
});
it
(
'
updates stores working reference
'
,
(
done
)
=>
{
...
...
@@ -209,6 +213,20 @@ describe('IDE commit module actions', () => {
.
catch
(
done
.
fail
);
});
it
(
'
resets all files changed status
'
,
(
done
)
=>
{
store
.
dispatch
(
'
commit/updateFilesAfterCommit
'
,
{
data
,
branch
,
})
.
then
(()
=>
{
store
.
state
.
openFiles
.
forEach
((
entry
)
=>
{
expect
(
entry
.
changed
).
toBeFalsy
();
});
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
it
(
'
removes all changed files
'
,
(
done
)
=>
{
store
.
dispatch
(
'
commit/updateFilesAfterCommit
'
,
{
data
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment