Add or update index entries matching files in the working directory. If pathspecs are specified, only files matching those pathspecs will be added.
(self, pathspecs: None | list[str | PathLike[str]] = None)
| 195 | check_error(err, io=True) |
| 196 | |
| 197 | def add_all(self, pathspecs: None | list[str | PathLike[str]] = None) -> None: |
| 198 | """Add or update index entries matching files in the working directory. |
| 199 | |
| 200 | If pathspecs are specified, only files matching those pathspecs will |
| 201 | be added. |
| 202 | """ |
| 203 | pathspecs = pathspecs or [] |
| 204 | with StrArray(pathspecs) as arr: |
| 205 | err = C.git_index_add_all(self._index, arr.ptr, 0, ffi.NULL, ffi.NULL) |
| 206 | check_error(err, io=True) |
| 207 | |
| 208 | def add(self, path_or_entry: 'IndexEntry | str | PathLike[str]') -> None: |
| 209 | """Add or update an entry in the Index. |