From 2fe47949437a737a083f30372a50918db55991c0 Mon Sep 17 00:00:00 2001 From: Allen Li Date: Fri, 19 Jul 2024 23:12:14 +0000 Subject: [PATCH] [git_cl] Fix cookie setting Bug: b/351071334 Change-Id: I0245e38b71b8c65e77dcc2aeee040121c725b440 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5718644 Commit-Queue: Allen Li Reviewed-by: Yiwei Zhang Reviewed-by: Robbie Iannucci --- git_cl.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/git_cl.py b/git_cl.py index 96759ac061..31d5b70e92 100755 --- a/git_cl.py +++ b/git_cl.py @@ -3698,7 +3698,7 @@ class GitAuthConfigChanger(object): # # Increment this when making changes to the config, so that reliant # code can determine whether the config needs to be re-applied. - VERSION: int = 1 + VERSION: int = 2 def __init__( self, @@ -3797,14 +3797,16 @@ class GitAuthConfigChanger(object): def _apply_gitcookies(self, cwd: str) -> None: """Apply config changes relating to gitcookies.""" + # TODO(ayatane): Clear invalid setting. Remove line after a few weeks + self._set_config(cwd, 'http.gitcookies', None, modify_all=True) if self.mode == GitConfigMode.NEW_AUTH: - # Override potential global gitcookie config - self._set_config(cwd, 'http.gitcookies', '', modify_all=True) + # Override potential global setting + self._set_config(cwd, 'http.cookieFile', '', modify_all=True) elif self.mode == GitConfigMode.NEW_AUTH_SSO: - # Override potential global gitcookie config - self._set_config(cwd, 'http.gitcookies', '', modify_all=True) + # Override potential global setting + self._set_config(cwd, 'http.cookieFile', '', modify_all=True) elif self.mode == GitConfigMode.OLD_AUTH: - self._set_config(cwd, 'http.gitcookies', None, modify_all=True) + self._set_config(cwd, 'http.cookieFile', None, modify_all=True) else: raise TypeError(f'Invalid mode {self.mode!r}')