Skip to content

Commit

Permalink
Update internal/controller/git/work_tree.go
Browse files Browse the repository at this point in the history
Signed-off-by: Kent Rancourt <[email protected]>

Co-authored-by: Hidde Beydals <[email protected]>
  • Loading branch information
krancour and hiddeco authored Dec 11, 2024
1 parent 0fac579 commit 95f7f03
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions internal/controller/git/work_tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,14 +326,20 @@ func (w *workTree) IsRebasing() (bool, error) {
return false, fmt.Errorf("error determining rebase status: %w", err)
}
rebaseMerge := filepath.Join(w.dir, strings.TrimSpace(string(res)))
if _, err = os.Stat(rebaseMerge); err == nil {
if _, err = os.Stat(rebaseMerge); !os.IsNotExist(err) {
if err != nil {
return false, err
}
return true, nil

Check warning on line 333 in internal/controller/git/work_tree.go

View check run for this annotation

Codecov / codecov/patch

internal/controller/git/work_tree.go#L323-L333

Added lines #L323 - L333 were not covered by tests
}
if res, err = libExec.Exec(w.buildGitCommand("rev-parse", "--git-path", "rebase-apply")); err != nil {
return false, fmt.Errorf("error determining rebase status: %w", err)
}
rebaseApply := filepath.Join(w.dir, strings.TrimSpace(string(res)))
if _, err = os.Stat(rebaseApply); err == nil {
if _, err = os.Stat(rebaseApply); !os.IsNotExist(err) {
if err != nil {
return false, err
}
return true, nil

Check warning on line 343 in internal/controller/git/work_tree.go

View check run for this annotation

Codecov / codecov/patch

internal/controller/git/work_tree.go#L335-L343

Added lines #L335 - L343 were not covered by tests
}
return false, nil

Check warning on line 345 in internal/controller/git/work_tree.go

View check run for this annotation

Codecov / codecov/patch

internal/controller/git/work_tree.go#L345

Added line #L345 was not covered by tests
Expand Down

0 comments on commit 95f7f03

Please sign in to comment.