// ĠCopyright Ġ 2 0 0 0 - 2 0 2 0 ĠJetBrains Ġs . r . o . ĠUse Ġof Ġthis Ġsource Ġcode Ġis Ġgoverned Ġby Ġthe ĠApache Ġ 2 . 0 Ġlicense Ġthat Ġcan Ġbe Ġfound Ġin Ġthe ĠLICENSE Ġfile . Ċ package Ġcom . intellij . vcs . commit Ċ Ċ import Ġcom . intellij . openapi . diagnostic . logger Ċ import Ġcom . intellij . openapi . project . D umb Service . is D umb Ċ import Ġcom . intellij . openapi . project . D umb Service . is D umb Aware Ċ import Ġcom . intellij . openapi . project . Project Ċ import Ġcom . intellij . openapi . vcs . changes . Commit Executor Ċ import Ġcom . intellij . openapi . vcs . check in . Check in Handler Ċ import Ġcom . intellij . openapi . vcs . check in . Commit Check Ċ Ċ private Ġval ĠLOG Ġ= Ġlogger < Non Modal Commit Workflow >() Ċ Ċ abstract Ġclass ĠNon Modal Commit Workflow ( project : ĠProject ) Ġ: ĠAbstract Commit Workflow ( project ) Ġ{ ĊĠ Ġoverride Ġfun Ġrun Before Commit Handler ( handler : ĠCheck in Handler , Ġexecutor : ĠCommit Executor ?): ĠCheck in Handler . Return Result Ġ{ ĊĠĠĠ Ġif Ġ(! handler . accept Executor ( executor )) Ġreturn ĠCheck in Handler . Return Result . COMMIT ĊĠĠĠ ĠLOG . debug (" Check in Handler . before Check in : Ġ$ handler ") ĊĊĠĠĠ Ġif Ġ( handler Ġis ĠCommit Check ) Ġ{ ĊĠĠĠĠĠ Ġif Ġ(! handler . isEnabled ()) ĊĠĠĠĠĠĠĠ Ġreturn ĠCheck in Handler . Return Result . COMMIT . also Ġ{ ĠLOG . debug (" Commit Ġcheck Ġdisabled Ġ$ handler ") Ġ} ĊĊĠĠĠĠĠ Ġif Ġ( is D umb ( project ) Ġ&& Ġ! is D umb Aware ( handler )) ĊĠĠĠĠĠĠĠ Ġreturn ĠCheck in Handler . Return Result . COMMIT . also Ġ{ ĠLOG . debug (" Skipped Ġcommit Ġcheck Ġin Ġd umb Ġmode Ġ$ handler ") Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġreturn Ġhandler . before Check in ( executor , Ġcommit Context . additional Data Consumer ) ĊĠ Ġ} Ċ }