<commit_before>package com.softwaremill.codebrag.repository

import org.apache.commons.lang3.SystemUtils
import scala.sys.process._
import java.nio.file.{Path, Paths}
import com.softwaremill.codebrag.repository.config.{RepoData, UserPassCredentials}

class GitSvnRepository(val repoData: RepoData) extends Repository with RepositoryAutoBuilder with GitSvnBranchesModel {

  private val CommandBase = "git svn rebase --quiet"

  protected def pullChangesForRepo() {
    runPullCommand
  }

  private def runPullCommand() {
    val repoPath = Paths.get(repoData.repoLocation)
    if(repoData.repoCredentials.isDefined) {
      repoData.repoCredentials.get match {
        case c: UserPassCredentials => runWithUserPassCredentials(repoPath, c)<commit_msg>Reset the repository before rebasing it. Avoids 'needs update' messages and prevent the repository not to be updated<commit_after>package com.softwaremill.codebrag.repository

import org.apache.commons.lang3.SystemUtils
import scala.sys.process._
import java.nio.file.{Path, Paths}
import com.softwaremill.codebrag.repository.config.{RepoData, UserPassCredentials}

class GitSvnRepository(val repoData: RepoData) extends Repository with RepositoryAutoBuilder with GitSvnBranchesModel {

  private val CommandBaseReset = "git reset --hard"
  private val CommandBase = "git svn rebase --quiet"

  protected def pullChangesForRepo() {
    runPullCommand
  }

  private def runPullCommand() {
    val repoPath = Paths.get(repoData.repoLocation)
    Process(CommandBaseReset, repoPath.toFile) !< ProcessLogger(logger info _)
    if(repoData.repoCredentials.isDefined) {
      repoData.repoCredentials.get match {
        case c: UserPassCredentials => runWithUserPassCredentials(repoPath, c)
{'fraction_non_alphanumeric': 0.0805523590333717, 'fraction_numerical': 0.0011507479861910242, 'mean_word_length': 5.1886120996441285, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, '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': '6004552', 'n_tokens_mistral': 511, 'n_tokens_neox': 506, 'n_words': 120}