MCPcopy Create free account
hub / github.com/libgit2/pygit2 / stash_pathspecs

Function stash_pathspecs

test/test_repository.py:453–462  ·  view source on GitHub ↗
(paths: list[str])

Source from the content-addressed store, hash-verified

451 assert testrepo.status()['untracked2.txt'] == FileStatus.WT_NEW
452
453 def stash_pathspecs(paths: list[str]) -> bool:
454 stash_id = testrepo.stash(
455 sig, message=stash_message, keep_all=True, paths=paths
456 )
457 stash_commit = testrepo[stash_id].peel(pygit2.Commit)
458 stash_diff = testrepo.diff(stash_commit.parents[0], stash_commit)
459 stash_files = set(
460 patch.delta.new_file.path for patch in utils.diff_safeiter(stash_diff)
461 )
462 return stash_files == set(paths)
463
464 # Stash a modified file
465 assert stash_pathspecs(['hello.txt'])

Callers 1

test_stash_partialFunction · 0.85

Calls 2

stashMethod · 0.80
diffMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…