INNER CODE UNIT · Python

run_git

panther-labs/panther-analysis · .scripts/claude_review.py:26

def run_git(*args):
    """Run a git command and return stdout, or None on failure."""
    try:
        result = subprocess.run(
            ["git", *args],
            capture_output=True,
            text=True,
            cwd=REPO_ROOT,
        )
        return result.stdout.strip() if result.returncode == 0 else None
    except FileNotFoundError:
        return None


def get_changed_files():
    """Get reviewable staged files."""
    output = run_git("diff", "--cached", "--name-only", "--diff-filter=ACMR")
    if not output:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…