File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
crates/gitbutler-branch-actions/src Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 1
1
use anyhow:: { Context , Result } ;
2
+ use but_core:: RepositoryExt ;
2
3
use gitbutler_command_context:: CommandContext ;
3
4
use gitbutler_oplog:: entry:: { OperationKind , SnapshotDetails } ;
4
5
use gitbutler_oplog:: { OplogExt , SnapshotExt } ;
@@ -189,6 +190,10 @@ pub fn push_stack(
189
190
remote : default_target. push_remote_name ( ) ,
190
191
branch_to_remote : vec ! [ ] ,
191
192
} ;
193
+ let gerrit_mode = gix_repo
194
+ . git_settings ( ) ?
195
+ . gitbutler_gerrit_mode
196
+ . unwrap_or ( false ) ;
192
197
193
198
let force_push_protection = !skip_force_push_protection && ctx. project ( ) . force_push_protection ;
194
199
@@ -230,12 +235,22 @@ pub fn push_stack(
230
235
}
231
236
}
232
237
238
+ let refspec = if gerrit_mode {
239
+ Some ( format ! (
240
+ "{}:refs/for/{}" ,
241
+ push_details. head,
242
+ default_target. branch. branch( )
243
+ ) )
244
+ } else {
245
+ None
246
+ } ;
247
+
233
248
ctx. push (
234
249
push_details. head ,
235
250
& push_details. remote_refname ,
236
251
with_force,
237
252
force_push_protection,
238
- None ,
253
+ refspec ,
239
254
Some ( Some ( stack. id ) ) ,
240
255
) ?;
241
256
You can’t perform that action at this time.
0 commit comments