@@ -5,7 +5,7 @@ import { IGitHubUser, IPullRequestInfo } from "./github-glue.js";
55import { PatchSeries , SendFunction } from "./patch-series.js" ;
66import { IPatchSeriesMetadata } from "./patch-series-metadata.js" ;
77import { PatchSeriesOptions } from "./patch-series-options.js" ;
8- import { IConfig , getConfig } from "./project-config.js" ;
8+ import { IConfig } from "./project-config.js" ;
99import { ISMTPOptions , parseHeadersAndSendMail , parseMBox , sendMail } from "./send-mail.js" ;
1010
1111export interface IGitGitGadgetOptions {
@@ -37,6 +37,7 @@ export class GitGitGadget {
3737 }
3838
3939 public static async get (
40+ config : IConfig ,
4041 gitGitGadgetDir : string ,
4142 workDir ?: string ,
4243 publishTagsAndNotesToRemote ?: string ,
@@ -90,7 +91,15 @@ export class GitGitGadget {
9091
9192 const [ options , allowedUsers ] = await GitGitGadget . readOptions ( notes ) ;
9293
93- return new GitGitGadget ( notes , options , allowedUsers , smtpOptions , publishTagsAndNotesToRemote , notesPushToken ) ;
94+ return new GitGitGadget (
95+ config ,
96+ notes ,
97+ options ,
98+ allowedUsers ,
99+ smtpOptions ,
100+ publishTagsAndNotesToRemote ,
101+ notesPushToken ,
102+ ) ;
94103 }
95104
96105 protected static async readOptions ( notes : GitNotes ) : Promise < [ IGitGitGadgetOptions , Set < string > ] > {
@@ -103,7 +112,7 @@ export class GitGitGadget {
103112 return [ options , allowedUsers ] ;
104113 }
105114
106- public readonly config : IConfig = getConfig ( ) ;
115+ public readonly config : IConfig ;
107116 public readonly workDir : string ;
108117 public readonly notes : GitNotes ;
109118 protected options : IGitGitGadgetOptions ;
@@ -115,6 +124,7 @@ export class GitGitGadget {
115124 private readonly publishToken : string | undefined ;
116125
117126 protected constructor (
127+ config : IConfig ,
118128 notes : GitNotes ,
119129 options : IGitGitGadgetOptions ,
120130 allowedUsers : Set < string > ,
@@ -125,6 +135,7 @@ export class GitGitGadget {
125135 if ( ! notes . workDir ) {
126136 throw new Error ( "Could not determine Git worktree" ) ;
127137 }
138+ this . config = config ;
128139 this . workDir = notes . workDir ;
129140 this . notes = notes ;
130141 this . options = options ;
@@ -291,6 +302,7 @@ export class GitGitGadget {
291302 options . rfc = pr . draft ?? false ;
292303
293304 const series = await PatchSeries . getFromNotes (
305+ this . config ,
294306 this . notes ,
295307 pr . pullRequestURL ,
296308 pr . title ,
0 commit comments