release: Claude Code v2.1.50 (15 patches)
This commit is contained in:
@@ -148,18 +148,31 @@ def ver_tuple(v):
|
||||
# ============================================================
|
||||
|
||||
def git_pull():
|
||||
"""Pull latest changes from remote."""
|
||||
"""Pull latest changes from remote (shallow fetch for minimal download)."""
|
||||
try:
|
||||
# Shallow fetch + reset — downloads only latest snapshot, not full history
|
||||
result = subprocess.run(
|
||||
["git", "pull", "--quiet"],
|
||||
cwd=SCRIPT_DIR, capture_output=True, text=True, timeout=30,
|
||||
["git", "fetch", "--depth", "1", "origin", "master"],
|
||||
cwd=SCRIPT_DIR, capture_output=True, text=True, timeout=60,
|
||||
)
|
||||
if result.returncode == 0:
|
||||
if result.returncode != 0:
|
||||
# Fallback to regular pull
|
||||
result = subprocess.run(
|
||||
["git", "pull", "--quiet"],
|
||||
cwd=SCRIPT_DIR, capture_output=True, text=True, timeout=60,
|
||||
)
|
||||
if result.returncode != 0:
|
||||
eprint(f" {Y}git pull warning: {result.stderr.strip()}{D}")
|
||||
return True
|
||||
eprint(f" {Y}git pull warning: {result.stderr.strip()}{D}")
|
||||
return True # non-fatal
|
||||
|
||||
# Reset to fetched state
|
||||
subprocess.run(
|
||||
["git", "reset", "--hard", "origin/master"],
|
||||
cwd=SCRIPT_DIR, capture_output=True, text=True, timeout=10,
|
||||
)
|
||||
return True
|
||||
except subprocess.TimeoutExpired:
|
||||
eprint(f" {Y}git pull timed out{D}")
|
||||
eprint(f" {Y}git fetch timed out{D}")
|
||||
return True
|
||||
except FileNotFoundError:
|
||||
eprint(f" {Y}git not found, skipping pull{D}")
|
||||
|
||||
Reference in New Issue
Block a user