Description
In \src/index.ts:106:
\\ s
program.parse()
\\
All four subcommand action handlers are \�sync\ functions. However, \program.parse()\ is called synchronously without \�wait. In Commander.js v12, \program.parse()\ is synchronous and does not await async action handlers. The correct method is \�wait program.parseAsync().
Impact
While Node.js typically keeps the event loop alive for pending promises, this is not guaranteed. If any unhandled error occurs elsewhere, or if the process is otherwise terminated, the async action handlers may be interrupted mid-execution. This creates a race condition where branch deletions, remote pruning, or garbage collection could be left in a partially completed state. Additionally, any promise rejections from async handlers become unhandled rejections rather than being catchable.
Suggested Fix
Change to \�wait program.parseAsync()\ and make the main function async.
Description
In \src/index.ts:106:
\\ s
program.parse()
\\
All four subcommand action handlers are \�sync\ functions. However, \program.parse()\ is called synchronously without \�wait. In Commander.js v12, \program.parse()\ is synchronous and does not await async action handlers. The correct method is \�wait program.parseAsync().
Impact
While Node.js typically keeps the event loop alive for pending promises, this is not guaranteed. If any unhandled error occurs elsewhere, or if the process is otherwise terminated, the async action handlers may be interrupted mid-execution. This creates a race condition where branch deletions, remote pruning, or garbage collection could be left in a partially completed state. Additionally, any promise rejections from async handlers become unhandled rejections rather than being catchable.
Suggested Fix
Change to \�wait program.parseAsync()\ and make the main function async.