code: def raise_exception_if_baseline_file_is_unstaged(filename):
      
      try:
          files_changed_but_not_staged = subprocess.check_output(
              [
                  'git',
                  'diff',
                  '--name-only',
              ],
          ).split()
      except subprocess.CalledProcessError:
          # Since we don't pipe stderr, we get free logging through git.
          raise ValueError
  
      if filename.encode() in files_changed_but_not_staged:
          log.error((
              'Your baseline file ({}) is unstaged.\n'
              '`git add {}` to fix this.'
          ).format(
              filename,
              filename,
          ))
  
          raise ValueError
docs: We want to make sure that if there are changes to the baseline
      file, they will be included in the commit. This way, we can keep
      our baselines up-to-date.
  
      :raises: ValueError