diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index 6d4e9e8491f9d9572dac0deb4809d74b4cdb4720..b8eba8881d556c90d01314f9dfb84a218940a3cc 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -68,8 +68,8 @@ module Gitlab
       end
 
       def commits(ref, path = nil, limit = nil, offset = nil)
-        if path
-          repo.log(ref, path, max_count: limit, skip: offset)
+        if path.present?
+          repo.log(ref, path, max_count: limit, skip: offset, follow: true)
         elsif limit && offset
           repo.commits(ref, limit, offset)
         else