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 committed Dec 16, 2024
1 parent 6b588b2 commit 4233dd5
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
}
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
}
return false, nil
Expand Down

0 comments on commit 4233dd5

Please sign in to comment.