Skip to content

Commit

Permalink
Merge branch 'master' of github.com:winton/gitcycle
Browse files Browse the repository at this point in the history
  • Loading branch information
winton committed Feb 4, 2012
2 parents 81a5644 + 7d310e8 commit 7272ad7
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion lib/gitcycle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@ def checkout(remote, branch=nil)
end
alias :co :checkout

def commit_all
branch_info = get('branch',
'branch[name]' => branches(:current => true),
'create' => 0
)

if branch_info && (title = branch_info["title"]) && id = branch_info["body"].match(/#\d+/)
commit_msg = "[#{id}] #{title}"
end

run "git add . && git commit -am" + (commit_msg ? " \"#{commit_msg}\"" : "")
end
alias :ca :commit_all

def create_branch(url_or_title, reset=false)
require_git && require_config

Expand Down Expand Up @@ -634,7 +648,8 @@ def get(path, hash={})
exit
end

error = json.match(/Gitcycle error reference code (\d+)/)[1]
match = json.match(/Gitcycle error reference code (\d+)/)
error = match && match[1]

if error
puts "\nSomething went wrong :(".red
Expand Down

0 comments on commit 7272ad7

Please sign in to comment.