Skip to content

Commit

Permalink
Merge pull request #841 from HParker/fix-assigned-but-unused-variable…
Browse files Browse the repository at this point in the history
…-warnings

Fix assigned but unused variable warnings in test
  • Loading branch information
carlosmn committed May 27, 2020
2 parents f1d82ee + 41d0de5 commit dbea077
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions test/repo_apply_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ def test_bare_repository_defaults_to_index
assert_index_content 'README', new_content, bare_repo

diff = bare_repo.diff(new_commit, original_commit)

assert_equal true, bare_repo.apply(diff)
assert_index_content 'README', original_content, bare_repo
end

def test_location_option
new_commit, new_content, original_content = update_file(@repo, 'README')
new_commit, _new_content, _original_content = update_file(@repo, 'README')

diff = @repo.diff(new_commit, @original_commit)

Expand Down Expand Up @@ -166,4 +166,4 @@ def test_callbacks
@repo.apply(diff, {:location => :index, :hunk_callback => 'this is not a callable object'})
end
end
end
end
2 changes: 1 addition & 1 deletion test/settings_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_used_cache_size

size = Rugged::Settings.used_cache_size
repo = FixtureRepo.from_libgit2("attr")
diff = repo.diff("605812a", "370fe9ec22", :context_lines => 1, :interhunk_lines => 1)
repo.diff("605812a", "370fe9ec22", :context_lines => 1, :interhunk_lines => 1)

# cache size should grow
assert_operator size, :<, Rugged::Settings.used_cache_size
Expand Down
4 changes: 2 additions & 2 deletions test/submodule_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def test_submodule_setup_add
end

# add a submodule using gitlink by default
submodule = @repo.submodules.setup_add(url, submod_path)
@repo.submodules.setup_add(url, submod_path)

assert File.file?(File.join(@repo.workdir, submod_path, '.git'))
assert File.directory?(File.join(@repo.path, 'modules'))
Expand All @@ -287,7 +287,7 @@ def test_submodule_setup_add

assert_equal url, @repo.config["submodule.#{submod_path}.url"]

submodule = @repo.submodules.setup_add(url, second_submod_path, gitlink: false)
@repo.submodules.setup_add(url, second_submod_path, gitlink: false)

assert File.directory?(File.join(@repo.workdir, second_submod_path, '.git'))
refute File.exist?(File.join(@repo.path, 'modules', second_submod_path))
Expand Down

0 comments on commit dbea077

Please sign in to comment.