{"record":{"id":"48a17e05f8828ac5","repo":"lerna/lerna","slug":"echanges","errorCode":"ECHANGES","errorMessage":"Local repository has un-committed changes","messagePattern":"Local repository has un-committed changes","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"libs/commands/import/src/index.ts","lineNumber":131,"sourceCode":"    //   \"--reverse\",\n    //   \"HEAD\",\n    // ]).split(\"\\n\");\n\n    if (!this.commits.length) {\n      throw new ValidationError(\"NOCOMMITS\", `No git commits to import at \"${inputPath}\"`);\n    }\n\n    if (this.options.preserveCommit) {\n      // Back these up since they'll change for each commit\n      this.origGitEmail = this.execSync(\"git\", [\"config\", \"user.email\"]);\n      this.origGitName = this.execSync(\"git\", [\"config\", \"user.name\"]);\n    }\n\n    // Stash the repo's pre-import head away in case something goes wrong.\n    this.preImportHead = this.getCurrentSHA();\n\n    if (this.execSync(\"git\", [\"diff-index\", \"HEAD\"])) {\n      throw new ValidationError(\"ECHANGES\", \"Local repository has un-committed changes\");\n    }\n\n    this.logger.info(\n      \"\",\n      `About to import ${this.commits.length} commits from ${inputPath} into ${targetDir}`\n    );\n\n    if (this.options.yes) {\n      return true;\n    }\n\n    return promptConfirmation(\"Are you sure you want to import these commits onto the current branch?\");\n  }\n\n  getPackageDirectories() {\n    return this.project.packageConfigs.filter((p) => p.endsWith(\"*\")).map((p) => path.dirname(p));\n  }\n","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/lerna/lerna/blob/35d15a1567932be97759f512d8b8033dad72b411/libs/commands/import/src/index.ts#L113-L149","documentation":"Error \"Local repository has un-committed changes\" thrown in lerna/lerna.","triggerScenarios":"Thrown at libs/commands/import/src/index.ts:131 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35d15a1567932be97759f512d8b8033dad72b411","analyzedAt":"2026-08-27T05:01:00.632Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}