gitlabhq / grit

Grit gives you object oriented read/write access to Git repositories via Ruby. Patched for GitLab
gitlab.org
MIT License
59 stars 55 forks source link

Fix returning wrong blob id bug in repo.diff(a, b, *paths) #25

Open ryosuzuki opened 11 years ago

ryosuzuki commented 11 years ago

Bug

Return wrong blob object when repo.diff like this

repo = Grit::Repo.new(".")
head = repo.commits.first
base = repo.commits.last

blob = repo.diff(base, head).first.b_blob
# => #<Grit::Blob "0218f96"> 

Fix

Return wrong blob object when repo.diff like this

repo = Grit::Repo.new(".")
head = repo.commits.first
base = repo.commits.last

blob = repo.diff(base, head).first.b_blob
=> #<Grit::Blob "00dd8a636fd79e9436f792cac68f9d2dd3708399"> 
coveralls commented 11 years ago

Coverage Status

Coverage remained the same when pulling 82d08a579dd9d6345ca3336431976a23ed409461 on mitakalab:diff into ca49cdd437626af3088083a9ad0c49adacb7135f on gitlabhq:master.