summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorscott Chacon <schacon@agadorsparticus.(none)>2007-11-27 08:21:28 -0800
committerscott Chacon <schacon@agadorsparticus.(none)>2007-11-27 08:21:28 -0800
commit6a9db968e8563bc27b8f56f9d413159a2e14cf67 (patch)
tree5094084caae36283763eba7a1965f93ad159608a /lib
parent07ebb951368ed31bdaebc2e820c62ced22c8bbe4 (diff)
downloadthird_party-ruby-git-6a9db968e8563bc27b8f56f9d413159a2e14cf67.tar.gz
third_party-ruby-git-6a9db968e8563bc27b8f56f9d413159a2e14cf67.tar.xz
third_party-ruby-git-6a9db968e8563bc27b8f56f9d413159a2e14cf67.zip
fixed issue with running a 'git log' with an object that won't rev-parse (file)
Diffstat (limited to 'lib')
-rw-r--r--lib/git/lib.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/git/lib.rb b/lib/git/lib.rb
index decd6d4..cd24fca 100644
--- a/lib/git/lib.rb
+++ b/lib/git/lib.rb
@@ -81,8 +81,10 @@ module Git
sha = revparse(opts[:object] || branch_current || 'master')
count = opts[:count] || 30
- repo = get_raw_repo
- return process_commit_data(repo.log(sha, count))
+ if /\w{40}/.match(sha) # valid sha
+ repo = get_raw_repo
+ return process_commit_data(repo.log(sha, count))
+ end
end
arr_opts = ['--pretty=raw']