code: def test_infer_versioning_metadata_on_dirty_repo(repo):
      """
      Test how `infer_versioning_metadata` fills its different fields
      when the uers's repo is dirty:
      `is_dirty`, `HEAD_sha`, `active_branch` and `diff_sha`.
      """
      existing_metadata = {}
      existing_metadata["user_script"] = ".git"
      vcs = resolve_config.infer_versioning_metadata(".git")
      repo.create_head("feature")
      repo.git.checkout("feature")
      with open("README.md", "w+") as f:
          f.write("dummy dummy content")
      vcs = resolve_config.infer_versioning_metadata(".git")
      assert vcs["is_dirty"]
      assert vcs["active_branch"] == "feature"
      assert vcs["diff_sha"] != hashlib.sha256(b"").hexdigest()
      repo.git.add("README.md")
      commit = repo.index.commit("Added dummy_file")
      vcs = resolve_config.infer_versioning_metadata(".git")
      assert not vcs["is_dirty"]
      assert vcs["HEAD_sha"] == commit.hexsha
      assert vcs["diff_sha"] == hashlib.sha256(b"").hexdigest()
  
imports: import hashlib
  import logging
  import os
  import shutil
  import git
  import pytest
  import orion.core
  import orion.core.io.resolve_config
label_desc: Use image node_id 40 for calling a global function with example usage: test_infer_versioning_metadata_on_dirty_repo(repo) without return types