Skip to content

Commit 5dda63e

Browse files
thegranddesignsds
thegranddesign
authored andcommitted
Make HookContext::PreCommit#initial_commit? public
Since it's being forwarded to, in Ruby 2.4 it throws a warning.
1 parent 767aaf0 commit 5dda63e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/overcommit/hook_context/pre_commit.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ def modified_lines_in_file(file)
126126
@modified_lines[file]
127127
end
128128

129+
# Returns whether the current git branch is empty (has no commits).
130+
def initial_commit?
131+
return @initial_commit unless @initial_commit.nil?
132+
@initial_commit = Overcommit::GitRepo.initial_commit?
133+
end
134+
129135
private
130136

131137
# Clears the working tree so that the stash can be applied.
@@ -170,12 +176,6 @@ def any_changes?
170176
modified_files.any?
171177
end
172178

173-
# Returns whether the current git branch is empty (has no commits).
174-
def initial_commit?
175-
return @initial_commit unless @initial_commit.nil?
176-
@initial_commit = Overcommit::GitRepo.initial_commit?
177-
end
178-
179179
# Stores the modification times for all modified files to make it appear like
180180
# they never changed.
181181
#

0 commit comments

Comments
 (0)