@@ -953,23 +953,6 @@ func (repo *GitRepo) PushNotesAndArchive(remote, notesRefPattern, archiveRefPatt
953
953
return nil
954
954
}
955
955
956
- // PushNotesForksAndArchive pushes the given notes, forks, and archive refs to a remote repo.
957
- func (repo * GitRepo ) PushNotesForksAndArchive (remote , notesRefPattern , forksRef , archiveRefPattern string ) error {
958
- if ! strings .HasPrefix (forksRef , devtoolsRefPrefix ) {
959
- return fmt .Errorf ("Unsupported forks ref: %q" , forksRef )
960
- }
961
- if ! strings .HasPrefix (archiveRefPattern , devtoolsRefPrefix ) {
962
- return fmt .Errorf ("Unsupported archive ref pattern: %q" , archiveRefPattern )
963
- }
964
- notesRefspec := fmt .Sprintf ("%s:%s" , notesRefPattern , notesRefPattern )
965
- devtoolsRefspec := fmt .Sprintf ("+%s*:%s*" , devtoolsRefPrefix , devtoolsRefPrefix )
966
- err := repo .runGitCommandInline ("push" , remote , notesRefspec , devtoolsRefspec )
967
- if err != nil {
968
- return fmt .Errorf ("Failed to push the local notes, forks, and archive to the remote '%s': %v" , remote , err )
969
- }
970
- return nil
971
- }
972
-
973
956
func getRemoteNotesRef (remote , localNotesRef string ) string {
974
957
relativeNotesRef := strings .TrimPrefix (localNotesRef , "refs/notes/" )
975
958
return "refs/notes/remotes/" + remote + "/" + relativeNotesRef
@@ -1276,3 +1259,13 @@ func (repo *GitRepo) PullNotesForksAndArchive(remote, notesRefPattern, forksRef,
1276
1259
}
1277
1260
return nil
1278
1261
}
1262
+
1263
+ // Push pushes the given refs to a remote repo.
1264
+ func (repo * GitRepo ) Push (remote string , refSpecs ... string ) error {
1265
+ pushArgs := append ([]string {"push" , remote }, refSpecs ... )
1266
+ err := repo .runGitCommandInline (pushArgs ... )
1267
+ if err != nil {
1268
+ return fmt .Errorf ("Failed to push the local refs to the remote '%s': %v" , remote , err )
1269
+ }
1270
+ return nil
1271
+ }
0 commit comments