diff options
Diffstat (limited to 'app/assets/javascripts/ide/stores/actions/merge_request.js')
-rw-r--r-- | app/assets/javascripts/ide/stores/actions/merge_request.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/app/assets/javascripts/ide/stores/actions/merge_request.js b/app/assets/javascripts/ide/stores/actions/merge_request.js index 1273e375859..6790c0fbdaa 100644 --- a/app/assets/javascripts/ide/stores/actions/merge_request.js +++ b/app/assets/javascripts/ide/stores/actions/merge_request.js @@ -152,15 +152,17 @@ export const openMergeRequest = ( .then(mr => { dispatch('setCurrentBranchId', mr.source_branch); - dispatch('getBranchData', { + // getFiles needs to be called after getting the branch data + // since files are fetched using the last commit sha of the branch + return dispatch('getBranchData', { projectId, branchId: mr.source_branch, - }); - - return dispatch('getFiles', { - projectId, - branchId: mr.source_branch, - }); + }).then(() => + dispatch('getFiles', { + projectId, + branchId: mr.source_branch, + }), + ); }) .then(() => dispatch('getMergeRequestVersions', { |