From 95f7f03c065d6bddca17c31eddc45e299600c274 Mon Sep 17 00:00:00 2001 From: Kent Rancourt Date: Wed, 11 Dec 2024 09:36:43 -0500 Subject: [PATCH] Update internal/controller/git/work_tree.go Signed-off-by: Kent Rancourt Co-authored-by: Hidde Beydals --- internal/controller/git/work_tree.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/controller/git/work_tree.go b/internal/controller/git/work_tree.go index 673c9d71a..79f37e595 100644 --- a/internal/controller/git/work_tree.go +++ b/internal/controller/git/work_tree.go @@ -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