Skip to content

Remove unneeded explicit return statements #812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def self.configure
end

def self.config
return Base.config
Base.config
end

def global_config(name = nil, value = nil)
Expand Down
2 changes: 1 addition & 1 deletion lib/git/diff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def name_status

def path(path)
@path = path
return self
self
end

def size
Expand Down
12 changes: 6 additions & 6 deletions lib/git/lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def describe(commit_ish = nil, opts = {})

arr_opts << commit_ish if commit_ish

return command('describe', *arr_opts)
command('describe', *arr_opts)
end

# Return the commits that are within the given revision range
Expand Down Expand Up @@ -472,7 +472,7 @@ def process_commit_data(data, sha)

hsh['message'] = data.join("\n") + "\n"

return hsh
hsh
end

CAT_FILE_HEADER_LINE = /\A(?<key>\w+) (?<value>.*)\z/
Expand Down Expand Up @@ -543,7 +543,7 @@ def process_tag_data(data, name)

hsh['message'] = data.join("\n") + "\n"

return hsh
hsh
end

def process_commit_log_data(data)
Expand Down Expand Up @@ -584,7 +584,7 @@ def process_commit_log_data(data)

hsh_array << hsh if hsh

return hsh_array
hsh_array
end

def ls_tree(sha, opts = {})
Expand Down Expand Up @@ -758,7 +758,7 @@ def current_branch_state
:unborn
end

return HeadState.new(state, branch_name)
HeadState.new(state, branch_name)
end

def branch_current
Expand Down Expand Up @@ -1488,7 +1488,7 @@ def archive(sha, file = nil, opts = {})
gz.write(file_content)
end
end
return file
file
end

# returns the current version of git, as an Array of Fixnums.
Expand Down
20 changes: 10 additions & 10 deletions lib/git/log.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,61 +82,61 @@ def all
def object(objectish)
dirty_log
@object = objectish
return self
self
end

def author(regex)
dirty_log
@author = regex
return self
self
end

def grep(regex)
dirty_log
@grep = regex
return self
self
end

def path(path)
dirty_log
@path = path
return self
self
end

def skip(num)
dirty_log
@skip = num
return self
self
end

def since(date)
dirty_log
@since = date
return self
self
end

def until(date)
dirty_log
@until = date
return self
self
end

def between(sha1, sha2 = nil)
dirty_log
@between = [sha1, sha2]
return self
self
end

def cherry
dirty_log
@cherry = true
return self
self
end

def merges
dirty_log
@merges = true
return self
self
end

def to_s
Expand Down