Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use different branch to expose issue with ref not getting updated

  • Loading branch information...
commit 25071dbee8b11976b91f3d16ab1a40b70a331974 1 parent 0bb015e
@bkeepers authored
Showing with 8 additions and 4 deletions.
  1. +1 −3 lib/adapter/git.rb
  2. +7 −1 spec/git_spec.rb
View
4 lib/adapter/git.rb
@@ -62,9 +62,7 @@ def commit(message)
yield index
- sha = index.commit(message, Array(commit))
-
- client.update_ref(branch, sha) unless head
+ index.commit(message, :parents => Array(commit), :head => branch)
end
end
View
8 spec/git_spec.rb
@@ -3,7 +3,7 @@
describe "Git adapter" do
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) }
before do
@@ -22,4 +22,10 @@
adapter.set('foo', 'bar')
client.get_head('foobar').should_not be_nil
end
+
+ it 'should successfully delete a key' do
+ adapter.set('foo', 'bar')
+ adapter.delete('foo')
+ adapter.get('foo').should be_nil
+ end
end

0 comments on commit 25071db

Please sign in to comment.
Something went wrong with that request. Please try again.