Skip to content
Snippets Groups Projects
Commit 6bb08542 authored by Paul Slaughter's avatar Paul Slaughter Committed by Phil Hughes
Browse files

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

parent a1f1460a
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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) {
Loading
Loading
---
title: Fix Web IDE unable to commit to same file twice
merge_request: 21372
author:
type: fixed
Loading
Loading
@@ -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);
Loading
Loading
@@ -266,19 +266,21 @@ describe('IDE commit module actions', () => {
});
 
describe('success', () => {
const COMMIT_RESPONSE = {
id: '123456',
short_id: '123',
message: 'test message',
committed_date: 'date',
stats: {
additions: '1',
deletions: '2',
},
};
beforeEach(() => {
spyOn(service, 'commit').and.returnValue(
Promise.resolve({
data: {
id: '123456',
short_id: '123',
message: 'test message',
committed_date: 'date',
stats: {
additions: '1',
deletions: '2',
},
},
data: COMMIT_RESPONSE,
}),
);
});
Loading
Loading
@@ -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();
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment