Sha256: 66d75dbf3a8e10accc19a1f62ff9b617aaf18ed0a39635d8f21592012b0a03bd

Contents?: true

Size: 477 Bytes

Versions: 37

Compression:

Stored size: 477 Bytes

Contents

module OhlohScm::Adapters
	class GitAdapter < AbstractAdapter

		def head_token
			run("git ls-remote --heads '#{url}' #{branch_name}") =~ /^(^[a-z0-9]{40})\s+\S+$/
			$1
		end

		def head
			verbose_commit(head_token)
		end

		def parent_tokens(commit)
			run("cd '#{url}' && git cat-file commit #{commit.token} | grep ^parent | cut -f 2 -d ' '").split("\n") || []
		end

		def parents(commit)
			parent_tokens(commit).collect { |token| verbose_commit(token) }
		end
	end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
ohloh_scm-2.5.1 lib/ohloh_scm/adapters/git/head.rb
ohloh_scm-2.4.14 lib/ohloh_scm/adapters/git/head.rb
ohloh_scm-2.4.13 lib/ohloh_scm/adapters/git/head.rb
ohloh_scm-2.4.12 lib/ohloh_scm/adapters/git/head.rb
ohloh_scm-2.4.11 lib/ohloh_scm/adapters/git/head.rb
ohloh_scm-2.4.10 lib/ohloh_scm/adapters/git/head.rb
ohloh_scm-2.4.9 lib/ohloh_scm/adapters/git/head.rb
ohloh_scm-2.4.8 lib/ohloh_scm/adapters/git/head.rb
ohloh_scm-2.4.7 lib/ohloh_scm/adapters/git/head.rb
ohloh_scm-2.4.6 lib/ohloh_scm/adapters/git/head.rb
ohloh_scm-2.4.5 lib/ohloh_scm/adapters/git/head.rb
ohloh_scm-2.4.4 lib/ohloh_scm/adapters/git/head.rb
ohloh_scm-2.4.3 lib/ohloh_scm/adapters/git/head.rb
ohloh_scm-2.4.1 lib/ohloh_scm/adapters/git/head.rb
ohloh_scm-2.4.0 lib/ohloh_scm/adapters/git/head.rb
ohloh_scm-2.3.5 lib/ohloh_scm/adapters/git/head.rb
ohloh_scm-2.3.4 lib/ohloh_scm/adapters/git/head.rb
ohloh_scm-2.3.2 lib/ohloh_scm/adapters/git/head.rb
ohloh_scm-2.3.1 lib/ohloh_scm/adapters/git/head.rb
ohloh_scm-2.3.0 lib/ohloh_scm/adapters/git/head.rb