@@ -69,6 +69,7 @@ def _ns(
6969 color : bool ,
7070 * ,
7171 all_files : bool = False ,
72+ remote_branch : Optional [str ] = None ,
7273 from_ref : Optional [str ] = None ,
7374 to_ref : Optional [str ] = None ,
7475 remote_name : Optional [str ] = None ,
@@ -79,6 +80,7 @@ def _ns(
7980 return argparse .Namespace (
8081 color = color ,
8182 hook_stage = hook_type .replace ('pre-' , '' ),
83+ remote_branch = remote_branch ,
8284 from_ref = from_ref ,
8385 to_ref = to_ref ,
8486 remote_name = remote_name ,
@@ -106,13 +108,14 @@ def _pre_push_ns(
106108 remote_url = args [1 ]
107109
108110 for line in stdin .decode ().splitlines ():
109- _ , local_sha , _ , remote_sha = line .split ()
111+ _ , local_sha , remote_branch , remote_sha = line .split ()
110112 if local_sha == Z40 :
111113 continue
112114 elif remote_sha != Z40 and _rev_exists (remote_sha ):
113115 return _ns (
114116 'pre-push' , color ,
115117 from_ref = remote_sha , to_ref = local_sha ,
118+ remote_branch = remote_branch ,
116119 remote_name = remote_name , remote_url = remote_url ,
117120 )
118121 else :
@@ -133,6 +136,7 @@ def _pre_push_ns(
133136 'pre-push' , color ,
134137 all_files = True ,
135138 remote_name = remote_name , remote_url = remote_url ,
139+ remote_branch = remote_branch ,
136140 )
137141 else :
138142 rev_cmd = ('git' , 'rev-parse' , f'{ first_ancestor } ^' )
@@ -141,6 +145,7 @@ def _pre_push_ns(
141145 'pre-push' , color ,
142146 from_ref = source , to_ref = local_sha ,
143147 remote_name = remote_name , remote_url = remote_url ,
148+ remote_branch = remote_branch ,
144149 )
145150
146151 # nothing to push
0 commit comments