diff options
-rw-r--r-- | app/services/files/base_service.rb | 2 | ||||
-rw-r--r-- | app/services/git_operation_service.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/services/files/base_service.rb b/app/services/files/base_service.rb index 3480cb70f67..c8a60422bf4 100644 --- a/app/services/files/base_service.rb +++ b/app/services/files/base_service.rb @@ -63,7 +63,7 @@ module Files end if !project.empty_repo? && different_branch? && repository.branch_exists?(@branch_name) - raise ValidationError, 'Branch with such name already exists. You need to switch to this branch in order to make changes' + raise ValidationError, "A branch called #{@branch_name} already exists. Switch to that branch in order to make changes" end end diff --git a/app/services/git_operation_service.rb b/app/services/git_operation_service.rb index 507e0a6680a..82ef34a4863 100644 --- a/app/services/git_operation_service.rb +++ b/app/services/git_operation_service.rb @@ -56,7 +56,7 @@ class GitOperationService start_project: repository.project, &block) - start_branch ||= branch_name + start_branch_name ||= branch_name verify_start_branch_exists!(start_project.repository, start_branch_name) @@ -154,7 +154,7 @@ class GitOperationService def verify_start_branch_exists!(start_repository, start_branch_name) return if start_repository.empty_repo? return if start_repository.branch_exists?(start_branch_name) - + raise ArgumentError, "Cannot find branch #{start_branch_name} in #{start_repository.path_with_namespace}" end end |