Skip to content

Commit

Permalink
Use different branch to expose issue with ref not getting updated
Browse files Browse the repository at this point in the history
  • Loading branch information
bkeepers committed Aug 26, 2011
1 parent 0bb015e commit 25071db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 1 addition & 3 deletions lib/adapter/git.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ def commit(message)


yield index yield index


sha = index.commit(message, Array(commit)) index.commit(message, :parents => Array(commit), :head => branch)

client.update_ref(branch, sha) unless head
end end


end end
Expand Down
8 changes: 7 additions & 1 deletion spec/git_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


describe "Git adapter" do describe "Git adapter" do
let(:repo_dir) { File.expand_path('../test-repo', __FILE__) } let(:repo_dir) { File.expand_path('../test-repo', __FILE__) }
let(:adapter) { Adapter[:git].new(client) } let(:adapter) { Adapter[:git].new(client, :branch => 'adapter-git') }
let(:client) { Grit::Repo.init(repo_dir) } let(:client) { Grit::Repo.init(repo_dir) }


before do before do
Expand All @@ -22,4 +22,10 @@
adapter.set('foo', 'bar') adapter.set('foo', 'bar')
client.get_head('foobar').should_not be_nil client.get_head('foobar').should_not be_nil
end end

it 'should successfully delete a key' do
adapter.set('foo', 'bar')
adapter.delete('foo')
adapter.get('foo').should be_nil
end
end end

0 comments on commit 25071db

Please sign in to comment.