Home / Function/ isRepoDirty() — tailwindcss Function Reference

isRepoDirty() — tailwindcss Function Reference

Architecture documentation for the isRepoDirty() function in git.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  23bc2bd8_47ba_4456_61d1_528eee3082ed["isRepoDirty()"]
  eb8ababf_fa35_08e1_76f8_c2b2cea868b8["run()"]
  eb8ababf_fa35_08e1_76f8_c2b2cea868b8 -->|calls| 23bc2bd8_47ba_4456_61d1_528eee3082ed
  style 23bc2bd8_47ba_4456_61d1_528eee3082ed fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/@tailwindcss-upgrade/src/utils/git.ts lines 3–17

export function isRepoDirty(cwd?: string) {
  try {
    let stdout = execSync('git status --porcelain', { encoding: 'utf-8', cwd })
    return stdout.trim() !== ''
  } catch (error) {
    // If it's not a git repository we don't know if it's dirty or not. But we
    // also don't want to block the migration. Maybe we can still fail and
    // require a `--force` flag?
    if (error?.toString?.().includes('not a git repository')) {
      return false
    }

    return true
  }
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does isRepoDirty() do?
isRepoDirty() is a function in the tailwindcss codebase.
What calls isRepoDirty()?
isRepoDirty() is called by 1 function(s): run.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free