import os
# print (os.getcwd())
# os.chdir('test-repo')
from otter.utils import chdir
with chdir("test-repo"):
import subprocess
# Function to run shell commands and capture their output
def run_shell_command(command):
# Run command and capture the output
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
output, error = process.communicate()
# Check if there are errors
if process.returncode != 0:
print(f"Error: {error.decode().strip()}")
return None
return output.decode().strip()
initial_hash = run_shell_command('git rev-parse HEAD')
print(initial_hash[:6] == "d892cc")
The test
gets converted to