Skip to content

Commit

Permalink
replace while true with loop do
Browse files Browse the repository at this point in the history
Not actually a conditional
  • Loading branch information
mroth committed Mar 23, 2014
1 parent f8531d6 commit e6b156b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bin/lolcommits
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,11 @@ end

def change_dir_to_root_or_repo!
debug "Walking up dir tree"
while true
loop do
cur = File.expand_path('.')
nxt = File.expand_path('..', cur)
if File.directory?(File.expand_path('.git')) || nxt == cur
# found root or git dir
return
return # found root or git dir
end
Dir.chdir(nxt)
end
Expand Down

0 comments on commit e6b156b

Please sign in to comment.