def do(self): if self.path is None: raise errors.UsageError('Error: unconfigured commit template', 'A commit template has not been configured.\n' 'Use "git config" to define "commit.template"\n' 'so that it points to a commit template.') return LoadCommitMessage.do(self)
def do(self): path = self.path if not path or not os.path.isfile(path): raise errors.UsageError('Error: cannot find commit template', '%s: No such file or directory.' % path) self.model.set_directory(os.path.dirname(path)) self.model.set_commitmsg(utils.slurp(path))