fix: use BRANCH variable in install.sh update path

The update path was hardcoded to origin/master. Now uses the
CODEMAN_BRANCH variable and updates the remote URL on upgrade.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
jaypark
2026-03-14 16:51:20 +09:00
co-authored by Claude Opus 4.6
parent da71d8d01c
commit 809bf6a614
+2 -1
View File
@@ -1065,13 +1065,14 @@ main() {
if [[ -d "$INSTALL_DIR/.git" ]]; then if [[ -d "$INSTALL_DIR/.git" ]]; then
info "Existing installation found, updating..." info "Existing installation found, updating..."
cd "$INSTALL_DIR" cd "$INSTALL_DIR"
git remote set-url origin "$REPO_URL" 2>/dev/null || true
# Check for local changes # Check for local changes
if ! git diff --quiet 2>/dev/null || ! git diff --staged --quiet 2>/dev/null; then if ! git diff --quiet 2>/dev/null || ! git diff --staged --quiet 2>/dev/null; then
warn "Local changes detected in $INSTALL_DIR" warn "Local changes detected in $INSTALL_DIR"
if prompt_yes_no "Discard local changes and update?" "n"; then if prompt_yes_no "Discard local changes and update?" "n"; then
git fetch --quiet origin git fetch --quiet origin
git reset --hard origin/master --quiet git reset --hard "origin/$BRANCH" --quiet
else else
info "Keeping existing installation, skipping update" info "Keeping existing installation, skipping update"
fi fi