@@ -70,6 +70,7 @@ def _ns(
7070 * ,
7171 all_files : bool = False ,
7272 remote_branch : Optional [str ] = None ,
73+ local_branch : Optional [str ] = None ,
7374 from_ref : Optional [str ] = None ,
7475 to_ref : Optional [str ] = None ,
7576 remote_name : Optional [str ] = None ,
@@ -82,6 +83,7 @@ def _ns(
8283 color = color ,
8384 hook_stage = hook_type .replace ('pre-' , '' ),
8485 remote_branch = remote_branch ,
86+ local_branch = local_branch ,
8587 from_ref = from_ref ,
8688 to_ref = to_ref ,
8789 remote_name = remote_name ,
@@ -110,14 +112,15 @@ def _pre_push_ns(
110112 remote_url = args [1 ]
111113
112114 for line in stdin .decode ().splitlines ():
113- _ , local_sha , remote_branch , remote_sha = line .split ()
115+ local_branch , local_sha , remote_branch , remote_sha = line .split ()
114116 if local_sha == Z40 :
115117 continue
116118 elif remote_sha != Z40 and _rev_exists (remote_sha ):
117119 return _ns (
118120 'pre-push' , color ,
119121 from_ref = remote_sha , to_ref = local_sha ,
120122 remote_branch = remote_branch ,
123+ local_branch = local_branch ,
121124 remote_name = remote_name , remote_url = remote_url ,
122125 )
123126 else :
@@ -139,6 +142,7 @@ def _pre_push_ns(
139142 all_files = True ,
140143 remote_name = remote_name , remote_url = remote_url ,
141144 remote_branch = remote_branch ,
145+ local_branch = local_branch ,
142146 )
143147 else :
144148 rev_cmd = ('git' , 'rev-parse' , f'{ first_ancestor } ^' )
@@ -148,6 +152,7 @@ def _pre_push_ns(
148152 from_ref = source , to_ref = local_sha ,
149153 remote_name = remote_name , remote_url = remote_url ,
150154 remote_branch = remote_branch ,
155+ local_branch = local_branch ,
151156 )
152157
153158 # nothing to push
0 commit comments