Skip to content

Commit

Permalink
Stop creating empty commits when saving duplicate values.
Browse files Browse the repository at this point in the history
  • Loading branch information
nreckart committed Dec 2, 2011
1 parent 09e9ce1 commit 4222293
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/gaga.rb
Expand Up @@ -20,8 +20,10 @@ def initialize(options = {})
#
# Returns nothing
def set(key, value, opts = {})
save(setup_commit_options({:message => "set '#{key}'"}.merge(opts))) do |index|
index.add(key_for(key), encode(value))
unless value == get(key)
save(setup_commit_options({:message => "set '#{key}'"}.merge(opts))) do |index|
index.add(key_for(key), encode(value))
end
end
end

Expand Down

0 comments on commit 4222293

Please sign in to comment.