lib/travis/client/repository.rb in travis-1.5.5 vs lib/travis/client/repository.rb in travis-1.5.6.travis.296.4

- old
+ new

@@ -116,10 +116,14 @@ def branches last_on_branch.map { |b| { b.commit.branch => b } }.inject(:merge) end def branch(name) - last_on_branch.detect { |b| b.commit.branch == name.to_s } + attributes['branches'] ||= {} + attributes['branches'][name] ||= begin + build = attributes['last_on_branch'].detect { |b| b.commit.branch == name.to_s } if attributes['last_on_branch'] + build || session.get("/repos/#{id}/branches/#{name}")['branch'] + end end def each_build(params = nil, &block) return enum_for(__method__, params) unless block_given? params ||= {}