class Autobuild::Git::Status

A {Importer::Status} object extended to store more git-specific information

This is the value returned by {Git#status}

Attributes

common_commit[R]
fetch_commit[R]
head_commit[R]

Public Class Methods

new(package, status, remote_commit, local_commit, common_commit) click to toggle source
Calls superclass method
# File lib/autobuild/import/git.rb, line 880
def initialize(package, status, remote_commit, local_commit, common_commit)
    super()
    @status        = status
    @fetch_commit  = fetch_commit
    @head_commit   = head_commit
    @common_commit = common_commit

    if remote_commit != common_commit
        @remote_commits = log(package, common_commit, remote_commit)
    end
    if local_commit != common_commit
        @local_commits = log(package, common_commit, local_commit)
    end
end

Public Instance Methods

log(package, from, to) click to toggle source
# File lib/autobuild/import/git.rb, line 899
def log(package, from, to)
    log = package.importer.run_git_bare(
        package, 'log', '--encoding=UTF-8',
        "--pretty=format:%h %cr %cn %s", "#{from}..#{to}")
    log.map do |line|
        line.strip.encode
    end
end
needs_update?() click to toggle source
# File lib/autobuild/import/git.rb, line 895
def needs_update?
    status == Status::NEEDS_MERGE || status == Status::SIMPLE_UPDATE
end