diff options
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index 3365f4ffdbf..5d942cb0422 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -326,6 +326,12 @@ class Commit # no-op but needs to be defined since #persisted? is defined end + WIP_REGEX = /\A\s*(((?i)(\[WIP\]|WIP:|WIP)\s|WIP$))|(fixup!|squash!)\s/.freeze + + def work_in_progress? + !!(title =~ WIP_REGEX) + end + private def commit_reference(from_project, referable_commit_id, full: false) |