Skip to content

Commit aa2959d

Browse files
committed
fix(commit): attach user info to backup for permission denied issue
When multi users commit in the same machine shared backup will cause permission deny. To resolve this issue, attach user info to the name of backup commit.
1 parent c51a521 commit aa2959d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

commitizen/commands/commit.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ def __init__(self, config: BaseConfig, arguments: dict):
2828
self.config: BaseConfig = config
2929
self.cz = factory.commiter_factory(self.config)
3030
self.arguments = arguments
31-
self.temp_file: str = os.path.join(tempfile.gettempdir(), "cz.commit.backup")
31+
self.temp_file: str = os.path.join(
32+
tempfile.gettempdir(),
33+
"cz.commit{user}.backup".format(user=os.environ.get("USER", "")),
34+
)
3235

3336
def read_backup_message(self) -> str:
3437
# Check the commit backup file exists

0 commit comments

Comments
 (0)