Sha256: f5caba7177fc204b49e0a59542e66abb2106a002ebf66f11c56401dce5a54bba

Contents?: true

Size: 713 Bytes

Versions: 52

Compression:

Stored size: 713 Bytes

Contents

# Copyright (C) the Rugged contributors.  All rights reserved.
#
# This file is part of Rugged, distributed under the MIT license.
# For full terms see the included LICENSE file.

module Rugged
  class Branch < Rugged::Reference
    def ==(other)
      other.instance_of?(Rugged::Branch) &&
        other.canonical_name == self.canonical_name
    end

    # Get the remote the branch belongs to.
    #
    # If the branch is remote returns the remote it belongs to.
    # In case of local branch, it returns the remote of the branch
    # it tracks or nil if there is no tracking branch.
    #
    def remote
      remote_name = self.remote_name
      @owner.remotes[remote_name] if remote_name
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
rugged-1.9.0 lib/rugged/branch.rb
rugged-1.7.2 lib/rugged/branch.rb
rugged-1.6.5 lib/rugged/branch.rb
rugged-1.7.1 lib/rugged/branch.rb
rugged-1.6.3 lib/rugged/branch.rb
rugged-1.6.2 lib/rugged/branch.rb
rugged-1.5.1 lib/rugged/branch.rb
rugged-1.4.5 lib/rugged/branch.rb
rugged-1.5.0.1 lib/rugged/branch.rb
rugged-1.5.0 lib/rugged/branch.rb
rugged-1.3.2.3 lib/rugged/branch.rb
rugged-1.4.4 lib/rugged/branch.rb
rugged-1.3.2.1 lib/rugged/branch.rb
rugged-1.4.3 lib/rugged/branch.rb
rugged-1.3.2 lib/rugged/branch.rb
rugged-1.4.2 lib/rugged/branch.rb
rugged-1.3.1 lib/rugged/branch.rb
rugged-1.3.0 lib/rugged/branch.rb
rugged-1.2.0 lib/rugged/branch.rb
rugged-1.1.1 lib/rugged/branch.rb