Permalink
Browse files

gitc commit --no-add option, doing a straight commit if merge commit

  • Loading branch information...
1 parent 7e933ef commit 2d086ee6d575168cbc867563f526e3c4ba76bc62 @winton committed Oct 3, 2012
Showing with 11 additions and 4 deletions.
  1. +11 −4 lib/gitcycle.rb
View
@@ -187,6 +187,7 @@ def checkout(*args)
def commit(*args)
msg = nil
+ no_add = args.delete("--no-add")
if args.empty?
require_git && require_config
@@ -205,13 +206,19 @@ def commit(*args)
end
end
- cmd = "git add . && git add . -u && git commit -a"
+ if no_add
+ cmd = "git commit"
+ else
+ cmd = "git add . && git add . -u && git commit -a"
+ end
- if msg
- run(cmd + "m #{msg.dump}")
+ if File.exists?("#{Dir.pwd}/.git/MERGE_HEAD")
+ Kernel.exec(cmd)
+ elsif msg
+ run(cmd + " -m #{msg.dump}")
Kernel.exec("git commit --amend")
elsif args.empty?
- run(cmd)
+ Kernel.exec(cmd)
else
exec_git(:commit, args)
end

0 comments on commit 2d086ee

Please sign in to comment.