<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _add_and_commit(self, doc_filepath, author, commit_msg):
 """Low level function used internally when you have an absolute filepath to add and commit"""

        try:
            git(self.gitdir, self.gitwd, "add", doc_filepath)
            git(self.gitdir, self.gitwd, "commit", author=author, message=commit_msg)
        except Exception as e:
            # We can ignore this if no changes are new,
            # otherwise raise a 400
            if "nothing to commit" in e.message:  # @EJM is this dangerous?
                _LOG.debug('"nothing to commit" found in error response')
            else:
                _LOG.exception('"git commit" failed')
                self.reset_hard()
                raise