MCPcopy Create free account
hub / github.com/Louisym/MiniCC / _read_git_diff

Function _read_git_diff

mini_claude_code/prompt.py:197–209  ·  view source on GitHub ↗

源码: prompt.rs:245-263

(cwd: Path)

Source from the content-addressed store, hash-verified

195
196
197def _read_git_diff(cwd: Path) -> Optional[str]:
198 """源码: prompt.rs:245-263"""
199 sections: list[str] = []
200
201 staged = _read_git_output(cwd, ["diff", "--cached"])
202 if staged and staged.strip():
203 sections.append(f"Staged changes:\n{staged.rstrip()}")
204
205 unstaged = _read_git_output(cwd, ["diff"])
206 if unstaged and unstaged.strip():
207 sections.append(f"Unstaged changes:\n{unstaged.rstrip()}")
208
209 return "\n\n".join(sections) if sections else None
210
211
212def _read_git_output(cwd: Path, args: list[str]) -> Optional[str]:

Callers 1

discover_with_gitMethod · 0.85

Calls 2

_read_git_outputFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected