File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
src/scmrepo/git/backend/dulwich Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -333,8 +333,10 @@ def add(
333333
334334 paths = [paths ] if isinstance (paths , str ) else list (paths )
335335
336+ worktree = self .repo .get_worktree ()
337+
336338 if update and not paths :
337- self . repo .stage (list (self .repo .open_index ()))
339+ worktree .stage (list (self .repo .open_index ()))
338340 return
339341
340342 files : list [bytes ] = [
@@ -345,13 +347,13 @@ def add(
345347 if os .name == "nt" :
346348 # NOTE: we need git/unix separator to compare against index
347349 # paths but repo.stage() expects to be called with OS paths
348- self . repo .stage (
350+ worktree .stage (
349351 [fname for fname in files if fname .replace (b"\\ " , b"/" ) in index ]
350352 )
351353 else :
352- self . repo .stage ([fname for fname in files if fname in index ])
354+ worktree .stage ([fname for fname in files if fname in index ])
353355 else :
354- self . repo .stage (files )
356+ worktree .stage (files )
355357
356358 def _expand_paths (self , paths : list [str ], force : bool = False ) -> Iterator [str ]:
357359 for path in paths :
You can’t perform that action at this time.
0 commit comments