Skip to content

Commit

Permalink
Merge pull request #1881 from adamchainz/issue_1880_patch_naming
Browse files Browse the repository at this point in the history
Include PID in patch filename
  • Loading branch information
asottile committed Apr 16, 2021
2 parents 559d8a7 + 4f2069e commit 52ada7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pre_commit/staged_files_only.py
Expand Up @@ -47,7 +47,7 @@ def _unstaged_changes_cleared(patch_dir: str) -> Generator[None, None, None]:
retcode=None,
)
if retcode and diff_stdout_binary.strip():
patch_filename = f'patch{int(time.time())}'
patch_filename = f'patch{int(time.time())}-{os.getpid()}'
patch_filename = os.path.join(patch_dir, patch_filename)
logger.warning('Unstaged files detected.')
logger.info(f'Stashing unstaged files to {patch_filename}.')
Expand Down

0 comments on commit 52ada7c

Please sign in to comment.