<commit_before>module BranchesHelper
  def can_remove_branch?(project, branch_name)
    if project.protected_branch? branch_name
      false
    elsif branch_name == project.repository.root_ref
      false
    else
      can?(current_user, :push_code, project)
    end
  end

  def can_push_branch?(project, branch_name)
    return false unless project.repository.branch_names.include?(branch_name)
    
    ::Gitlab::GitAccess.new(current_user, project).can_push_to_branch?(branch_name)
  end
end<commit_msg>feature customisation: Remove "Remove source branch" for all non-admins in merge requests<commit_after>module BranchesHelper
  def can_remove_branch?(project, branch_name)
    if project.protected_branch? branch_name
      false
    elsif branch_name == project.repository.root_ref
      false
    elsif !current_user.is_admin? #CUSTOM - only admins can remove branches
      false
    else
      can?(current_user, :push_code, project)
    end
  end

  def can_push_branch?(project, branch_name)
    return false unless project.repository.branch_names.include?(branch_name)
    
    ::Gitlab::GitAccess.new(current_user, project).can_push_to_branch?(branch_name)
  end
end
{'fraction_non_alphanumeric': 0.07698815566835872, 'fraction_numerical': 0.0, 'mean_word_length': 4.304932735426009, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '219204', 'n_tokens_mistral': 361, 'n_tokens_neox': 363, 'n_words': 79}