{"record":{"id":"4bd9f0edee9e919a","repo":"eyaltoledano/claude-task-master","slug":"projectroot-is-required-for-checkandautoswitchgitt","errorCode":null,"errorMessage":"projectRoot is required for checkAndAutoSwitchGitTag","messagePattern":"projectRoot is required for checkAndAutoSwitchGitTag","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"scripts/modules/utils/git-utils.js","lineNumber":285,"sourceCode":"\ttry {\n\t\tconst currentBranch = await getCurrentBranch(projectRoot);\n\t\tconst defaultBranch = await getDefaultBranch(projectRoot);\n\t\treturn currentBranch && defaultBranch && currentBranch === defaultBranch;\n\t} catch (error) {\n\t\treturn false;\n\t}\n}\n\n/**\n * Check and automatically switch tags based on git branch if enabled\n * This runs automatically during task operations, similar to migration\n * @param {string} projectRoot - Project root directory (required)\n * @param {string} tasksPath - Path to tasks.json file\n * @returns {Promise<void>}\n */\nasync function checkAndAutoSwitchGitTag(projectRoot, tasksPath) {\n\tif (!projectRoot) {\n\t\tthrow new Error('projectRoot is required for checkAndAutoSwitchGitTag');\n\t}\n\n\t// DISABLED: Automatic git workflow is too rigid and opinionated\n\t// Users should explicitly use git-tag commands if they want integration\n\treturn;\n}\n\n/**\n * Synchronous version of git tag checking and switching\n * This runs during readJSON to ensure git integration happens BEFORE tag resolution\n * @param {string} projectRoot - Project root directory (required)\n * @param {string} tasksPath - Path to tasks.json file\n * @returns {void}\n */\nfunction checkAndAutoSwitchGitTagSync(projectRoot, tasksPath) {\n\tif (!projectRoot) {\n\t\treturn; // Can't proceed without project root\n\t}","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/scripts/modules/utils/git-utils.js#L267-L303","documentation":"checkAndAutoSwitchGitTag() requires projectRoot as its first argument for signature consistency, throwing when it is missing even though the function body is currently disabled and returns immediately. The guard exists so future re-enablement and callers keep the correct contract.","triggerScenarios":"Calling checkAndAutoSwitchGitTag() without a projectRoot string (undefined/null/empty), regardless of tasksPath.","commonSituations":"Legacy call sites that invoked the helper before projectRoot was threaded through; scripts calling it with only tasksPath.","solutions":["Pass the project root as the first argument","Note the function is a no-op (auto git tag switching is disabled) — consider removing the call entirely","Validate projectRoot resolution before invoking"],"exampleFix":"// before\nawait checkAndAutoSwitchGitTag(tasksPath);\n// after\nawait checkAndAutoSwitchGitTag(projectRoot, tasksPath);","handlingStrategy":"validation","validationCode":"if (!projectRoot) { /* function is a no-op anyway */ return; }\nawait checkAndAutoSwitchGitTag(projectRoot, tasksPath);","typeGuard":"function hasProjectRoot(root) { return typeof root === 'string' && root.length > 0; }","tryCatchPattern":"try {\n  await checkAndAutoSwitchGitTag(projectRoot, tasksPath);\n} catch (err) {\n  if (err.message.includes('projectRoot is required')) console.warn('Skipping git tag check: no project root');\n  else throw err;\n}","preventionTips":["Note this feature is disabled — avoid calling it; use explicit git-tag commands instead","Always pass projectRoot as the first argument if you must call it"],"tags":["git","argument-validation","missing-parameter","disabled-feature"],"backgroundTag":"missing-required-argument","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}