Skip to content

Commit

Permalink
download_strategy: ensure fixed commit hash length
Browse files Browse the repository at this point in the history
The length of the commit hash returned for `--short` can vary depending
on user configuration. Make sure this works independently of what might
have been configured via a user's `.gitconfig`. This also fixes the
failing `GitDownloadStrategyTests#test_last_commit` test for such users.
  • Loading branch information
UniqMartin committed Jul 7, 2016
1 parent 68bbe6e commit 32f7e73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Library/Homebrew/download_strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ def source_modified_time
end

def last_commit
Utils.popen_read("git", "--git-dir", git_dir ,"rev-parse", "--short", "HEAD").chomp
Utils.popen_read("git", "--git-dir", git_dir, "rev-parse", "--short=7", "HEAD").chomp
end

private
Expand Down

0 comments on commit 32f7e73

Please sign in to comment.