From 61d5a5053407c15e801303062bfa5ac1d9eec027 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Sun, 21 Sep 2025 22:44:14 -0700 Subject: [PATCH] Revert "fix `is_dirty` when switching branch with `updated` (#36162)" This reverts commit 30c388aea8961113555211201c6298099d53e4df. --- system/updated/updated.py | 2 -- system/version.py | 7 +++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/system/updated/updated.py b/system/updated/updated.py index f9fad5f6f5..a80a663ec9 100755 --- a/system/updated/updated.py +++ b/system/updated/updated.py @@ -113,7 +113,6 @@ def setup_git_options(cwd: str) -> None: ("protocol.version", "2"), ("gc.auto", "0"), ("gc.autoDetach", "false"), - ("remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*"), ] for option, value in git_cfg: run(["git", "config", option, value], cwd) @@ -390,7 +389,6 @@ class Updater: cloudlog.info("git reset in progress") cmds = [ ["git", "checkout", "--force", "--no-recurse-submodules", "-B", branch, "FETCH_HEAD"], - ["git", "branch", "--set-upstream-to", f"origin/{branch}"], ["git", "reset", "--hard"], ["git", "clean", "-xdff"], ["git", "submodule", "sync"], diff --git a/system/version.py b/system/version.py index e32c3d6033..5e4fcf5c33 100755 --- a/system/version.py +++ b/system/version.py @@ -37,7 +37,9 @@ def is_prebuilt(path: str = BASEDIR) -> bool: @cache def is_dirty(cwd: str = BASEDIR) -> bool: - if not get_origin() or not get_short_branch(): + origin = get_origin() + branch = get_branch() + if not origin or not branch: return True dirty = False @@ -50,9 +52,6 @@ def is_dirty(cwd: str = BASEDIR) -> bool: except subprocess.CalledProcessError: pass - branch = get_branch() - if not branch: - return True dirty = (subprocess.call(["git", "diff-index", "--quiet", branch, "--"], cwd=cwd)) != 0 except subprocess.CalledProcessError: cloudlog.exception("git subprocess failed while checking dirty")