sync-worktrees 4.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1110,7 +1110,7 @@ function makeGitProgressHandler(logger, emitProgress) {
1110
1110
  lastBucket.set(key, bucket);
1111
1111
  const total = event.total > 0 ? `${event.processed}/${event.total}` : `${event.processed}`;
1112
1112
  const message = `${event.method} ${event.stage}: ${event.progress}% (${total})`;
1113
- logger.info(` \u21B3 ${message}`);
1113
+ logger.debug(` \u21B3 ${message}`);
1114
1114
  emitProgress?.({
1115
1115
  phase: event.method,
1116
1116
  message,
@@ -2756,8 +2756,9 @@ function sanitizeGitEnv(env) {
2756
2756
  return sanitized;
2757
2757
  }
2758
2758
  var GitService = class {
2759
- constructor(config, logger) {
2759
+ constructor(config, logger, progressEmitter) {
2760
2760
  this.config = config;
2761
+ this.progressEmitter = progressEmitter;
2761
2762
  this.logger = logger ?? Logger.createDefault(void 0, config.debug);
2762
2763
  this.bareRepoPath = this.config.bareRepoDir || getDefaultBareRepoDir(this.config.repoUrl);
2763
2764
  this.mainWorktreePath = path8.join(this.config.worktreeDir, GIT_CONSTANTS.DEFAULT_BRANCH);
@@ -2798,7 +2799,9 @@ var GitService = class {
2798
2799
  return git;
2799
2800
  }
2800
2801
  buildSimpleGitOptions(blockMs) {
2801
- const options = { progress: makeGitProgressHandler(this.logger) };
2802
+ const options = {
2803
+ progress: makeGitProgressHandler(this.logger, (event) => this.progressEmitter?.(event))
2804
+ };
2802
2805
  if (blockMs > 0) options.timeout = { block: blockMs };
2803
2806
  return options;
2804
2807
  }
@@ -4618,7 +4621,7 @@ var WorktreeSyncService = class {
4618
4621
  constructor(config) {
4619
4622
  this.config = config;
4620
4623
  this.logger = config.logger ?? Logger.createDefault(void 0, config.debug);
4621
- this.gitService = new GitService(config, this.logger);
4624
+ this.gitService = new GitService(config, this.logger, (event) => this.emitProgress(event));
4622
4625
  this.repoOperationLock = new RepoOperationLock(config, this.gitService, this.logger);
4623
4626
  this.retryPolicy = new SyncRetryPolicy(config, this.gitService, this.logger);
4624
4627
  this.worktreeModeSyncRunner = new WorktreeModeSyncRunner(