Skip to content

Commit

Permalink
feat: fossil.username is a string now
Browse files Browse the repository at this point in the history
  • Loading branch information
senyai committed Jun 4, 2024
1 parent 64861fa commit 7bee741
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ about cloning from the extension.
`"true"` — enabled
`"false"` — disabled, manual refresh still available.

`fossil.path { string / null }`
`fossil.path { string }`

* Specifies an explicit `fossil` file path to use.
* This should only be used if `fossil` cannot be found automatically.
* The default behaviour is to search for `fossil` in commonly-known
install locations and on the PATH.
* The default behaviour is to search for `fossil` on the PATH.
* Takes effect immediately.

`fossil.username { string / null }`
`fossil.username { string }`

* Specifies an explicit user to use for fossil commits.
* This should only be used if the user is different than the fossil default user.
Expand Down
8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1061,12 +1061,8 @@
"description": "%config.path%"
},
"fossil.username": {
"type": [
"string",
"null"
],
"description": "%config.username%",
"default": null
"type": "string",
"description": "%config.username%"
},
"fossil.confirmGitExport": {
"type": "string",
Expand Down
4 changes: 2 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface ConfigScheme {
ignoreMissingFossilWarning: boolean;
path: UnvalidatedFossilExecutablePath;
autoInOutInterval: number;
username: FossilUsername | null;
username: FossilUsername; // must be ignored when empty
autoRefresh: boolean;
enableRenaming: boolean;
confirmGitExport: 'Automatically' | 'Never' | null;
Expand Down Expand Up @@ -58,7 +58,7 @@ class Config {
* * This should only be used if the user is different
* than the fossil default user.
*/
get username(): FossilUsername | null {
get username(): FossilUsername {
return this.get('username');
}

Expand Down
4 changes: 2 additions & 2 deletions src/openedRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,14 @@ export class OpenedRepository {
async commit(
message: FossilCommitMessage,
fileList: RelativePath[],
user: FossilUsername | null,
user: FossilUsername,
newBranch: NewBranchOptions | undefined
): Promise<ExecResult> {
// always pass a message, otherwise fossil
// internal editor will spawn
return this.exec([
'commit',
...(user ? ['--user-override', user] : []),
...(user.length ? ['--user-override', user] : []),
...(newBranch
? [
...(newBranch.branch
Expand Down

0 comments on commit 7bee741

Please sign in to comment.