code: def is_dirty(self, index=True, working_tree=True, untracked_files=False,
                   submodules=True, path=None):
          
          if self._bare:
              # Bare repositories with no associated working directory are
              # always consired to be clean.
              return False
  
          # start from the one which is fastest to evaluate
          default_args = ['--abbrev=40', '--full-index', '--raw']
          if not submodules:
              default_args.append('--ignore-submodules')
          if path:
              default_args.append(path)
          if index:
              # diff index against HEAD
              if osp.isfile(self.index.path) and \
                      len(self.git.diff('--cached', *default_args)):
                  return True
          # END index handling
          if working_tree:
              # diff index against working tree
              if len(self.git.diff(*default_args)):
                  return True
          # END working tree handling
          if untracked_files:
              if len(self._get_untracked_files(path, ignore_submodules=not submodules)):
                  return True
          # END untracked files
          return False
docs: :return:
              ``True``, the repository is considered dirty. By default it will react
              like a git-status without untracked files, hence it is dirty if the
              index or the working copy have changes.