Checkout branch name, not commit oid

This commit is contained in:
Alex Gleason committed 2025-12-28 15:50:57 -06:00
1 parent 243853b6c8
commit f5036b8b56
1 file changed
+3 -4
+3 -4
View File
@@ -146,13 +146,12 @@ export class ProjectsManager {
force: true,
});
// Directly checkout the remote commit to update working directory
// This bypasses merge entirely and just makes the working directory
// match the remote commit exactly. Safe for templates.
// Checkout the branch (not the commit SHA) to update working directory
// This keeps the repository on the branch instead of entering detached HEAD state
// Using force: true to overwrite any local changes
await this.git.checkout({
dir: templatePath,
ref: remoteOid,
ref: branchName,
force: true,
});
}