Skip to content

Commit

Permalink
Remove the ruby refdb backend code again.
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurschreiber committed Oct 13, 2015
1 parent c6a2dab commit fe7acc7
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 147 deletions.
1 change: 0 additions & 1 deletion ext/rugged/rugged.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ void Init_rugged(void)

Init_rugged_refdb();
Init_rugged_refdb_backend();
Init_rugged_refdb_backend_custom();
Init_rugged_refdb_backend_fs();

Init_rugged_odb();
Expand Down
1 change: 0 additions & 1 deletion ext/rugged/rugged.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ void Init_rugged_cred(void);
void Init_rugged_backend(void);
void Init_rugged_refdb(void);
void Init_rugged_refdb_backend(void);
void Init_rugged_refdb_backend_custom(void);
void Init_rugged_refdb_backend_fs(void);
void Init_rugged_odb(void);
void Init_rugged_odb_backend(void);
Expand Down
107 changes: 0 additions & 107 deletions ext/rugged/rugged_refdb_backend_custom.c

This file was deleted.

38 changes: 0 additions & 38 deletions test/refdb_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,42 +24,4 @@ def test_set_backend_reuse_error
refdb.backend = backend
end
end

def test_custom_backend
refdb = Rugged::Refdb.new(@repo)

compress_calls = 0
backend = Rugged::Refdb::Backend::Custom.new(@repo)
backend.send(:define_singleton_method, :compress) do
compress_calls += 1
end

refdb.backend = backend
refdb.compress

assert_equal 1, compress_calls
end
end

class RefdbBackendCustomTest < Rugged::TestCase
def setup
@repo = FixtureRepo.from_rugged("testrepo.git")
@refdb = Rugged::Refdb.new(@repo)
@backend = Rugged::Refdb::Backend::Custom.new(@repo)
@refdb.backend = @backend
@repo.refdb = @refdb
end

def test_lookup
@backend.send(:define_singleton_method, :lookup) do |ref_name|
"1385f264afb75a56a5bec74243be9b367ba4ca08" if ref_name == "refs/heads/master"
end

ref = @repo.references["refs/heads/master"]
assert ref
assert_equal "refs/heads/master", ref.name
assert_equal "1385f264afb75a56a5bec74243be9b367ba4ca08", ref.target_id

assert_nil @repo.references["refs/heads/development"]
end
end

0 comments on commit fe7acc7

Please sign in to comment.