mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-20 12:23:22 +00:00
doGitInit() previously committed immediately (only .gitignore), but installSkillIfNeeded() runs later — leaving skill files uncommitted. This caused "Local changes detected" on first pull. Move commit to a single commitSourceFiles() call at the end of init, after all files are in place. Covers all scenarios: performFreshInit (first-time init): - No remote, no skill → 1 commit: "Initial commit" (.gitignore) - No remote, with skill → 1 commit: "Initial skills" (.gitignore + skill) - Remote empty → same as above, remote fetch is no-op - Remote has skills → reset --hard to remote; commitSourceFiles is no-op - Remote unreachable → same as no-remote (fetch fails gracefully) handleExistingInit (init --remote on existing config): - Git exists → commitSourceFiles is no-op (already committed) - Git not exists, remote reachable → commit before setupGitRemote so HEAD exists for reset --hard - Git not exists, remote unreachable → commit .gitignore so push/pull don't see "Local changes detected"