Skip to content

Commit

Permalink
Make gash commit the changes when all files are removed
Browse files Browse the repository at this point in the history
This should be fixed properly in gash. AFAIK, we dont understand how the changed? == !@sha1, or the implications in gash for altering how the @sha1 is used to determine changed. This fix is to avoid touching @sha1. Its not meant to be the optimum / elegant solution.
  • Loading branch information
dreamcat4 committed Apr 8, 2010
1 parent a67ec0e commit 8f45d51
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
@@ -1,3 +1,4 @@
v0.1.3 Commit the changes when all files are removed.
v0.1.2 Include hidden files that start in a period (.).
v0.1.1 Allows full git refspec to push to (in place of g.branch). Other minor fixes.
v0.1. First version.
19 changes: 18 additions & 1 deletion lib/grancher.rb
Expand Up @@ -65,6 +65,17 @@
# end
#
#

class Gash
def commit(msg, opts={})
puts opts.inspect
return unless changed? || opts[:force]
commit = commit_tree(to_tree!, msg)
@sha1 = git_tree_sha1
commit
end
end

class Grancher
attr_accessor :branch, :refspec, :push_to, :repo, :message
attr_reader :gash, :files, :directories
Expand Down Expand Up @@ -132,7 +143,13 @@ def push

# Commits the changes.
def commit(message = nil)
build.commit(message || message())
old_keys = gash.keys
build
if gash.keys.sort == old_keys.sort
gash.commit(message || message())
else
gash.commit(message || message(), :force => true)
end
end

private
Expand Down

1 comment on commit 8f45d51

@judofyr
Copy link
Owner

@judofyr judofyr commented on 8f45d51 Apr 9, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you try to pull the latest Gash from Git, and see if it fixes your problem?

Please sign in to comment.