lib/kosmos/git_adapter.rb in kosmos-0.0.1 vs lib/kosmos/git_adapter.rb in kosmos-0.0.2.pre.test2
- old
+ new
@@ -4,24 +4,26 @@
module GitAdapter
class << self
def init_repo(path)
Dir.chdir(path) do
`git init`
+
+ File.open('.gitignore', 'w') do |file|
+ file.write "!*\n"
+ end
end
end
def commit_everything(repo_path, commit_message)
Dir.chdir(repo_path) do
`git add -A -f`
`git commit --allow-empty -m #{commit_message.shellescape}`
end
end
- def revert_commit(repo_path, commit, commit_message)
+ def revert_commit(repo_path, commit)
Dir.chdir(repo_path) do
`git revert --no-commit #{commit.sha}`
- `git add -A -f`
- `git commit --allow-empty -m #{commit_message.shellescape}`
end
end
def list_commits(repo_path)
Dir.chdir(repo_path) do