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::{
4
4
sync:: {
5
5
branch:: branch_set_upstream_after_push,
6
6
cred:: BasicAuthCredential ,
7
+ get_branch_upstream_merge,
7
8
remotes:: { proxy_auto, Callbacks } ,
8
9
repository:: repo,
9
10
CommitId , RepoPath ,
@@ -163,9 +164,19 @@ pub fn push_raw(
163
164
PushType :: Tag => "tags" ,
164
165
} ;
165
166
166
- let branch_name =
167
+ let mut push_ref =
167
168
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) ) ?;
169
180
170
181
if let Some ( ( reference, msg) ) =
171
182
callbacks. get_stats ( ) ?. push_rejected_msg
You can’t perform that action at this time.
0 commit comments