Skip to content

Commit

Permalink
Merge pull request mojombo#140 from sbryant/fix_rev_parse
Browse files Browse the repository at this point in the history
Fix an edge case in rev_parse.
  • Loading branch information
rtomayko committed Sep 4, 2012
2 parents 83658e5 + 3811d81 commit 4cdb531
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/grit/git-ruby.rb
Expand Up @@ -75,7 +75,10 @@ def rev_list(options, *refs)
def rev_parse(options, string)
raise RuntimeError, "invalid string: #{string.inspect}" unless string.is_a?(String)

if string =~ /\.\./
# Split ranges, but don't split when specifying a ref:path.
# Don't split HEAD:some/path/in/repo..txt
# Do split sha1..sha2
if string !~ /:/ && string =~ /\.\./
(sha1, sha2) = string.split('..')
return [rev_parse({}, sha1), rev_parse({}, sha2)]
end
Expand Down

0 comments on commit 4cdb531

Please sign in to comment.