Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit 2d086ee6d575168cbc867563f526e3c4ba76bc62 1 parent 7e933ef
@winton authored
Showing with 11 additions and 4 deletions.
  1. +11 −4 lib/gitcycle.rb
View
15 lib/gitcycle.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.