Skip to content

Commit a2fbfd6

Browse files
committed
Rescue CommandError so we don't push empty commits, but don't fail either
1 parent a7068f1 commit a2fbfd6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/entitlements/util/gitrepo.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ def clone(dir)
7979
Contract String, String => nil
8080
def commit(dir, commit_message)
8181
validate_git_repository!(dir)
82-
git(dir, ["commit", "-m", commit_message])
82+
begin
83+
git(dir, ["commit", "-m", commit_message])
84+
rescue Entitlements::Util::GitRepo::CommandError
85+
logger.info "No changes to git repository"
86+
end
8387
nil
8488
end
8589

0 commit comments

Comments
 (0)