summaryrefslogtreecommitdiffstats
path: root/git_superproject.py
diff options
context:
space:
mode:
authorGavin Mak <gavinmak@google.com>2026-04-24 23:12:41 +0000
committergerrit-scoped@luci-project-accounts.iam.gserviceaccount.com <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2026-04-28 10:49:54 -0700
commit12cfc6036a590fa8b573e9ebec0a2873956668b2 (patch)
treeab0786a4b7bf61f90dd0dbf078c12c8cf0aeb859 /git_superproject.py
parent134eeb024bb172f425ef0823485b5cb537112f6c (diff)
downloadgit-repo-12cfc6036a590fa8b573e9ebec0a2873956668b2.tar.gz
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 <gavinmak@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'git_superproject.py')
-rw-r--r--git_superproject.py11
1 files changed, 6 insertions, 5 deletions
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:
100 self._manifest = manifest 100 self._manifest = manifest
101 self.name = name 101 self.name = name
102 self.remote = remote 102 self.remote = remote
103 self.revision = self._branch = revision 103 self.revision = revision
104 self._repodir = manifest.repodir 104 self._repodir = manifest.repodir
105 self._superproject_dir = superproject_dir 105 self._superproject_dir = superproject_dir
106 self._superproject_path = manifest.SubmanifestInfoDir( 106 self._superproject_path = manifest.SubmanifestInfoDir(
@@ -199,7 +199,8 @@ class Superproject:
199 def _LogMessagePrefix(self): 199 def _LogMessagePrefix(self):
200 """Returns the prefix string to be logged in each log message""" 200 """Returns the prefix string to be logged in each log message"""
201 return ( 201 return (
202 f"repo superproject branch: {self._branch} url: {self._remote_url}" 202 f"repo superproject revision: {self.revision} "
203 f"url: {self._remote_url}"
203 ) 204 )
204 205
205 def _LogError(self, fmt, *inputs): 206 def _LogError(self, fmt, *inputs):
@@ -312,8 +313,8 @@ class Superproject:
312 if rev_commit: 313 if rev_commit:
313 cmd.extend(["--negotiation-tip", rev_commit]) 314 cmd.extend(["--negotiation-tip", rev_commit])
314 315
315 if self._branch: 316 if self.revision:
316 cmd += [self._branch + ":" + self._branch] 317 cmd += [self.revision + ":" + self.revision]
317 p = GitCommand( 318 p = GitCommand(
318 None, 319 None,
319 cmd, 320 cmd,
@@ -348,7 +349,7 @@ class Superproject:
348 ) 349 )
349 return None 350 return None
350 data = None 351 data = None
351 branch = "HEAD" if not self._branch else self._branch 352 branch = "HEAD" if not self.revision else self.revision
352 cmd = ["ls-tree", "-z", "-r", branch] 353 cmd = ["ls-tree", "-z", "-r", branch]
353 354
354 p = GitCommand( 355 p = GitCommand(