Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 52ada7c

Browse files
authored
Merge pull request #1881 from adamchainz/issue_1880_patch_naming
Include PID in patch filename
2 parents 559d8a7 + 4f2069e commit 52ada7c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pre_commit/staged_files_only.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def _unstaged_changes_cleared(patch_dir: str) -> Generator[None, None, None]:
4747
retcode=None,
4848
)
4949
if retcode and diff_stdout_binary.strip():
50-
patch_filename = f'patch{int(time.time())}'
50+
patch_filename = f'patch{int(time.time())}-{os.getpid()}'
5151
patch_filename = os.path.join(patch_dir, patch_filename)
5252
logger.warning('Unstaged files detected.')
5353
logger.info(f'Stashing unstaged files to {patch_filename}.')

0 commit comments

Comments
 (0)