diff options
author | Rubén Dávila <rdavila84@gmail.com> | 2016-02-03 18:28:40 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-02-19 13:14:50 -0500 |
commit | 806139936898726b32c4fe216ac3a9f4419ce91e (patch) | |
tree | 7329f75325b00fe74999ed1d5d384c9ff01038d3 /app/models/commit.rb | |
parent | 34e26b8212954dba32165c39b63858658b82c0f0 (diff) | |
download | gitlab-ce-806139936898726b32c4fe216ac3a9f4419ce91e.tar.gz |
Add RevertService class with basic logic to revert commit
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index 23b771aebb7..e05bddc24c6 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -215,6 +215,14 @@ class Commit ci_commit.try(:status) || :not_found end + def revert_branch_name + "revert-#{project.id}-#{short_id}" + end + + def revert_message + "Revert \"#{safe_message.lines.first}\"".truncate(80) + "\n\nReverts #{to_reference}" + end + private def repo_changes |