From 12cfc6036a590fa8b573e9ebec0a2873956668b2 Mon Sep 17 00:00:00 2001 From: Gavin Mak Date: Fri, 24 Apr 2026 23:12:41 +0000 Subject: git_superproject: Remove redundant _branch variable Both variables were initialized to the same value and never modified. Bug: 416589884 Change-Id: Iaa1ffffb4543d4cd9391ac679d9234fe01678861 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/576921 Tested-by: Gavin Mak Commit-Queue: Gavin Mak Reviewed-by: Mike Frysinger --- git_superproject.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'git_superproject.py') diff --git a/git_superproject.py b/git_superproject.py index 12ac3dec6..81a6b2e59 100644 --- a/git_superproject.py +++ b/git_superproject.py @@ -100,7 +100,7 @@ class Superproject: self._manifest = manifest self.name = name self.remote = remote - self.revision = self._branch = revision + self.revision = revision self._repodir = manifest.repodir self._superproject_dir = superproject_dir self._superproject_path = manifest.SubmanifestInfoDir( @@ -199,7 +199,8 @@ class Superproject: def _LogMessagePrefix(self): """Returns the prefix string to be logged in each log message""" return ( - f"repo superproject branch: {self._branch} url: {self._remote_url}" + f"repo superproject revision: {self.revision} " + f"url: {self._remote_url}" ) def _LogError(self, fmt, *inputs): @@ -312,8 +313,8 @@ class Superproject: if rev_commit: cmd.extend(["--negotiation-tip", rev_commit]) - if self._branch: - cmd += [self._branch + ":" + self._branch] + if self.revision: + cmd += [self.revision + ":" + self.revision] p = GitCommand( None, cmd, @@ -348,7 +349,7 @@ class Superproject: ) return None data = None - branch = "HEAD" if not self._branch else self._branch + branch = "HEAD" if not self.revision else self.revision cmd = ["ls-tree", "-z", "-r", branch] p = GitCommand( -- cgit v1.2.3-54-g00ecf