diff --git a/src/auto_commit_service/__pycache__/app.cpython-312.pyc b/src/auto_commit_service/__pycache__/app.cpython-312.pyc index abf5ccf..3d57a08 100644 Binary files a/src/auto_commit_service/__pycache__/app.cpython-312.pyc and b/src/auto_commit_service/__pycache__/app.cpython-312.pyc differ diff --git a/src/auto_commit_service/__pycache__/config.cpython-312.pyc b/src/auto_commit_service/__pycache__/config.cpython-312.pyc index 02cf655..a080626 100644 Binary files a/src/auto_commit_service/__pycache__/config.cpython-312.pyc and b/src/auto_commit_service/__pycache__/config.cpython-312.pyc differ diff --git a/src/auto_commit_service/__pycache__/models.cpython-312.pyc b/src/auto_commit_service/__pycache__/models.cpython-312.pyc index be12b0a..6b70611 100644 Binary files a/src/auto_commit_service/__pycache__/models.cpython-312.pyc and b/src/auto_commit_service/__pycache__/models.cpython-312.pyc differ diff --git a/src/auto_commit_service/git/__pycache__/operations.cpython-312.pyc b/src/auto_commit_service/git/__pycache__/operations.cpython-312.pyc index f434fee..3cee339 100644 Binary files a/src/auto_commit_service/git/__pycache__/operations.cpython-312.pyc and b/src/auto_commit_service/git/__pycache__/operations.cpython-312.pyc differ diff --git a/src/auto_commit_service/git/operations.py b/src/auto_commit_service/git/operations.py index 73b28e0..bf00024 100644 --- a/src/auto_commit_service/git/operations.py +++ b/src/auto_commit_service/git/operations.py @@ -203,9 +203,11 @@ async def git_check_ignored(repo_path: Path, files: list[str]) -> list[str]: if returncode == 0: # All files in batch are safe safe_files.extend(batch) - elif returncode == 128 and "ignored" in stderr.lower(): + elif (returncode == 1 or returncode == 128) and "ignored" in stderr.lower(): # Some files are ignored - parse error message to find which ones # Git error format: "The following paths are ignored by one of your .gitignore files:\npath1\npath2" + # Exit code 1 = some files ignored, 128 = all files ignored + batch_ignored = [] lines = stderr.split("\n") for i, line in enumerate(lines): if "following paths are ignored" in line.lower(): @@ -215,10 +217,11 @@ async def git_check_ignored(repo_path: Path, files: list[str]) -> list[str]: break ignored_path = ignored_line.strip() if ignored_path: + batch_ignored.append(ignored_path) ignored_files.append(ignored_path) # Files not in ignored list are safe - safe_files.extend([f for f in batch if f not in ignored_files and not any(f.startswith(ig + "/") for ig in ignored_files)]) + safe_files.extend([f for f in batch if f not in batch_ignored and not any(f.startswith(ig + "/") for ig in batch_ignored)]) else: # Unknown error - be conservative and include all files logger.warning(f"git add --dry-run returned {returncode}: {stderr}, including all files from batch") diff --git a/src/auto_commit_service/scheduler/__pycache__/daemon.cpython-312.pyc b/src/auto_commit_service/scheduler/__pycache__/daemon.cpython-312.pyc index ca40ec1..6bb2b91 100644 Binary files a/src/auto_commit_service/scheduler/__pycache__/daemon.cpython-312.pyc and b/src/auto_commit_service/scheduler/__pycache__/daemon.cpython-312.pyc differ