diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/editor/source_editor_instance.js | 8 | ||||
-rw-r--r-- | app/services/merge_requests/squash_service.rb | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/app/assets/javascripts/editor/source_editor_instance.js b/app/assets/javascripts/editor/source_editor_instance.js index 8372a59964b..95a43c2b2d0 100644 --- a/app/assets/javascripts/editor/source_editor_instance.js +++ b/app/assets/javascripts/editor/source_editor_instance.js @@ -50,6 +50,10 @@ const utils = { } return extensionsStore.get(extensionName); }, + + hasFullApiRegistered: (targetMethods, newMethods) => { + return newMethods.find((fn) => !targetMethods.includes(fn)) === undefined; + }, }; /** Class representing a Source Editor Instance */ @@ -132,7 +136,9 @@ export default class EditorInstance { const existingExt = utils.getStoredExtension(extensionsStore, definition.extensionName); if (existingExt) { if (isEqual(extension.setupOptions, existingExt.setupOptions)) { - return existingExt; + if (utils.hasFullApiRegistered(this.extensionsAPI, Object.keys(existingExt.api))) { + return existingExt; + } } this.unuseExtension(extensionsStore, existingExt); } diff --git a/app/services/merge_requests/squash_service.rb b/app/services/merge_requests/squash_service.rb index 0600fd1d740..90cf4af7e41 100644 --- a/app/services/merge_requests/squash_service.rb +++ b/app/services/merge_requests/squash_service.rb @@ -5,7 +5,7 @@ module MergeRequests def execute # If performing a squash would result in no change, then # immediately return a success message without performing a squash - if merge_request.commits_count == 1 && message == merge_request.first_commit.safe_message + if merge_request.commits_count == 1 && message&.strip == merge_request.first_commit.safe_message&.strip return success(squash_sha: merge_request.diff_head_sha) end |