Merge pull request #3164 from 0dd/fix-git-add-validation
Add Path validation
This commit is contained in:
commit
862e717ff7
1 changed files with 2 additions and 1 deletions
|
|
@ -132,7 +132,8 @@ def git_add(repo: git.Repo, files: list[str]) -> str:
|
|||
if files == ["."]:
|
||||
repo.git.add(".")
|
||||
else:
|
||||
repo.index.add(files)
|
||||
# Use '--' to prevent files starting with '-' from being interpreted as options
|
||||
repo.git.add("--", *files)
|
||||
return "Files staged successfully"
|
||||
|
||||
def git_reset(repo: git.Repo) -> str:
|
||||
|
|
|
|||
Loading…
Reference in a new issue