Sha256: 5855f9c475f817fa61def41959580d8e91a519127e1de6f2f3b12c51b6405d60

Contents?: true

Size: 524 Bytes

Versions: 10

Compression:

Stored size: 524 Bytes

Contents

module OhlohScm::Adapters
  class GitSvnAdapter < AbstractAdapter
    def cat_file(commit, diff)
      cat(git_commit(commit), diff.path)
    end

    def cat_file_parent(commit, diff)
      cat("#{ git_commit(commit) }^", diff.path)
    end

    private

    def cat(revision, file_path)
      file_path = %Q{#{file_path}}
      run("cd #{self.url} && git show #{ revision }:#{ file_path }").strip
    end

    def git_commit(commit)
      run("cd #{self.url} && git svn find-rev r#{commit.token}").strip
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ohloh_scm-2.4.13 lib/ohloh_scm/adapters/git_svn/cat_file.rb
ohloh_scm-2.4.12 lib/ohloh_scm/adapters/git_svn/cat_file.rb
ohloh_scm-2.4.11 lib/ohloh_scm/adapters/git_svn/cat_file.rb
ohloh_scm-2.4.10 lib/ohloh_scm/adapters/git_svn/cat_file.rb
ohloh_scm-2.4.9 lib/ohloh_scm/adapters/git_svn/cat_file.rb
ohloh_scm-2.4.8 lib/ohloh_scm/adapters/git_svn/cat_file.rb
ohloh_scm-2.4.7 lib/ohloh_scm/adapters/git_svn/cat_file.rb
ohloh_scm-2.4.6 lib/ohloh_scm/adapters/git_svn/cat_file.rb
ohloh_scm-2.4.5 lib/ohloh_scm/adapters/git_svn/cat_file.rb
ohloh_scm-2.4.4 lib/ohloh_scm/adapters/git_svn/cat_file.rb