Commit 6bb08542 authored by Paul Slaughter's avatar Paul Slaughter Committed by Phil Hughes

Resolve "It's impossible to commit twice to the same branch"

parent a1f1460a
......@@ -146,13 +146,7 @@ export default {
staged: false,
prevPath: '',
moved: false,
lastCommit: Object.assign(state.entries[file.path].lastCommit, {
id: lastCommit.commit.id,
url: lastCommit.commit_path,
message: lastCommit.commit.message,
author: lastCommit.commit.author_name,
updatedAt: lastCommit.commit.authored_date,
}),
lastCommitSha: lastCommit.commit.id,
});
if (prevPath) {
......
---
title: Fix Web IDE unable to commit to same file twice
merge_request: 21372
author:
type: fixed
......@@ -184,7 +184,7 @@ describe('IDE commit module actions', () => {
branch,
})
.then(() => {
expect(f.lastCommit.message).toBe(data.message);
expect(f.lastCommitSha).toBe(data.id);
})
.then(done)
.catch(done.fail);
......@@ -266,10 +266,7 @@ describe('IDE commit module actions', () => {
});
describe('success', () => {
beforeEach(() => {
spyOn(service, 'commit').and.returnValue(
Promise.resolve({
data: {
const COMMIT_RESPONSE = {
id: '123456',
short_id: '123',
message: 'test message',
......@@ -278,7 +275,12 @@ describe('IDE commit module actions', () => {
additions: '1',
deletions: '2',
},
},
};
beforeEach(() => {
spyOn(service, 'commit').and.returnValue(
Promise.resolve({
data: COMMIT_RESPONSE,
}),
);
});
......@@ -352,8 +354,8 @@ describe('IDE commit module actions', () => {
store
.dispatch('commit/commitChanges')
.then(() => {
expect(store.state.entries[store.state.openFiles[0].path].lastCommit.message).toBe(
'test message',
expect(store.state.entries[store.state.openFiles[0].path].lastCommitSha).toBe(
COMMIT_RESPONSE.id,
);
done();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment