Skip to content

Commit fcae179

Browse files
authored
fix(gitsyncer): suppress any error returned by rebase abort (#126)
Release v2.2.1
1 parent 73b45c6 commit fcae179

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company
44
SPDX-License-Identifier: Apache-2.0
55
-->
66

7+
## v2.2.1 - 2025-01-20
8+
9+
- Fix suppress any errors on git rebase --abort
10+
711
## v2.2.0 - 2025-01-20
812

913
- Fix suppress error if no rebase in progress

pkg/git/git.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,8 @@ func (g *Git) GetRemoteHEADCommitHash() (string, error) {
6767

6868
// PullRebase pulls and rebases.
6969
func (g *Git) PullRebase() error {
70-
_, err := g.run("rebase", "--abort")
71-
if err != nil {
72-
// ignore error if there is no rebase in progress
73-
if !strings.Contains(err.Error(), "no rebase in progress") {
74-
return errors.Wrap(err, "git rebase --abort failed")
75-
}
76-
}
77-
_, err = g.run(
70+
_, _ = g.run("rebase", "--abort") //nolint:errcheck
71+
_, err := g.run(
7872
"-c", fmt.Sprintf(`user.name="%s"`, g.AuthorName),
7973
"-c", fmt.Sprintf(`user.email="%s"`, g.AuthorEmail),
8074
"pull",

0 commit comments

Comments
 (0)