cmt-cli 1.2.1__tar.gz → 1.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/PKG-INFO +1 -1
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/pyproject.toml +1 -1
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/cli.py +1 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/git/repository.py +4 -15
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/uv.lock +1 -1
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/.github/workflows/test.yml +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/.gitignore +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/.python-version +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/LICENSE +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/README.md +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/art/cmt-cli.svg +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/__init__.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/ai/__init__.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/ai/cache.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/ai/openai.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/ai/prompt.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/ai/provider.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/analysis/__init__.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/analysis/analyzer.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/core/__init__.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/core/console.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/core/logging.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/core/settings.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/enums/__init__.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/enums/config.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/exceptions.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/git/__init__.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/models/__init__.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/models/changes.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/models/suggestion.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/schemas/__init__.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/schemas/config.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/schemas/general.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/services/__init__.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/services/pypi.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/src/cmt/utils.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/tests/__init__.py +0 -0
- {cmt_cli-1.2.1 → cmt_cli-1.2.3}/tests/unit/test_repository.py +0 -0
|
@@ -12,20 +12,12 @@ class Repository:
|
|
|
12
12
|
def _execute(self, command: list[str]) -> subprocess.CompletedProcess:
|
|
13
13
|
try:
|
|
14
14
|
return subprocess.run(
|
|
15
|
-
command,
|
|
16
|
-
cwd=self.root,
|
|
17
|
-
capture_output=True,
|
|
18
|
-
check=True,
|
|
19
|
-
text=True
|
|
15
|
+
command, cwd=self.root, capture_output=True, check=True, text=True
|
|
20
16
|
)
|
|
21
17
|
except subprocess.CalledProcessError as e:
|
|
22
|
-
# Git writes some failure messages (e.g. "nothing to commit") to
|
|
23
|
-
# stdout rather than stderr, so both are checked.
|
|
24
18
|
output = "\n".join(filter(None, [e.stdout, e.stderr])).strip()
|
|
25
19
|
output = output or "no error output was returned."
|
|
26
|
-
raise GitError(
|
|
27
|
-
f"Command '{' '.join(command)}' failed:\n{output}"
|
|
28
|
-
) from e
|
|
20
|
+
raise GitError(output) from e
|
|
29
21
|
|
|
30
22
|
def is_git_repository(self):
|
|
31
23
|
try:
|
|
@@ -51,10 +43,7 @@ class Repository:
|
|
|
51
43
|
return result.stdout
|
|
52
44
|
|
|
53
45
|
def get_staged_changes(self) -> StagedChangeSet:
|
|
54
|
-
return StagedChangeSet(
|
|
55
|
-
files=self._get_staged_files(),
|
|
56
|
-
diff=self._get_staged_diff()
|
|
57
|
-
)
|
|
46
|
+
return StagedChangeSet(files=self._get_staged_files(), diff=self._get_staged_diff())
|
|
58
47
|
|
|
59
48
|
def commit(self, message: str) -> subprocess.CompletedProcess:
|
|
60
|
-
return self._execute(["git", "commit", "-m", message])
|
|
49
|
+
return self._execute(["git", "commit", "-m", message])
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|