File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
asyncgit/src/sync/remotes Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ use crate::{
44 sync:: {
55 branch:: branch_set_upstream_after_push,
66 cred:: BasicAuthCredential ,
7+ get_branch_upstream_merge,
78 remotes:: { proxy_auto, Callbacks } ,
89 repository:: repo,
910 CommitId , RepoPath ,
@@ -163,9 +164,19 @@ pub fn push_raw(
163164 PushType :: Tag => "tags" ,
164165 } ;
165166
166- let branch_name =
167+ let mut push_ref =
167168 format ! ( "{branch_modifier}refs/{ref_type}/{branch}" ) ;
168- remote. push ( & [ branch_name. as_str ( ) ] , Some ( & mut options) ) ?;
169+
170+ if !delete {
171+ if let Ok ( Some ( branch_upstream_merge) ) =
172+ get_branch_upstream_merge ( repo_path, branch)
173+ {
174+ push_ref. push_str ( & format ! ( ":{branch_upstream_merge}" ) ) ;
175+ }
176+ }
177+
178+ log:: debug!( "push to: {push_ref}" ) ;
179+ remote. push ( & [ push_ref] , Some ( & mut options) ) ?;
169180
170181 if let Some ( ( reference, msg) ) =
171182 callbacks. get_stats ( ) ?. push_rejected_msg
You can’t perform that action at this time.
0 commit comments