-// Copyright 2017-present The Hugo Authors. All rights reserved.
+// Copyright 2024 The Hugo Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
mainVersion := newVersion
mainVersion.PatchLevel = 0
+ r.gitPull()
+
defer r.gitPush()
if r.step == 1 {
return newVersion, finalVersion
}
+func (r *ReleaseHandler) gitPull() {
+ if _, err := r.git("pull", "origin", "HEAD"); err != nil {
+ log.Fatal("pull failed:", err)
+ }
+}
+
func (r *ReleaseHandler) gitPush() {
if r.skipPush {
return