Skip to content

Commit 2d6bae1

Browse files
committed
Marks temp files as read-only to avoid saves
1 parent 965f7f8 commit 2d6bae1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
## [Unreleased]
8+
### Changed
9+
- Marks temporary files (used when showing comparisions with previous revisions) as read-only to help avoid accidental edits/saving
10+
811
### Fixed
912
- Fixes issues where quick pick menu progress indicators will get stuck in some cases because of a vscode api change in [Microsoft/vscode#46102](https://github.com/Microsoft/vscode/pull/46102)
1013

src/git/git.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,10 @@ export class Git {
196196
return;
197197
}
198198

199-
resolve(destination);
199+
const ReadOnly = 0o100444; // 33060 0b1000000100100100
200+
fs.chmod(destination, ReadOnly, err => {
201+
resolve(destination);
202+
});
200203
});
201204
});
202205
});

0 commit comments

Comments
 (0)