From dc522e3afaa910ee87e69fdb02870b9d35088d95 Mon Sep 17 00:00:00 2001 From: yiannis Date: Thu, 2 Nov 2023 10:21:05 +0000 Subject: [PATCH] chore: Remove unused code previously used for GitOps Run --- pkg/run/git_exec.go | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 pkg/run/git_exec.go diff --git a/pkg/run/git_exec.go b/pkg/run/git_exec.go deleted file mode 100644 index 1d6c0d7fdf..0000000000 --- a/pkg/run/git_exec.go +++ /dev/null @@ -1,44 +0,0 @@ -package run - -import ( - "os/exec" - "strings" -) - -func GetBranchName() (string, error) { - cmd := exec.Command("git", "rev-parse", "--abbrev-ref", "HEAD") - out, err := cmd.Output() - - if err != nil { - return "", err - } - - return strings.TrimSpace(string(out)), nil -} - -func GetCommitID() (string, error) { - cmd := exec.Command("git", "rev-parse", "HEAD") - out, err := cmd.Output() - - if err != nil { - return "", err - } - - commitID := strings.TrimSpace(string(out)) - if len(commitID) > 8 { - commitID = commitID[:8] - } - - return commitID, nil -} - -func IsDirty() (bool, error) { - cmd := exec.Command("git", "status", "--porcelain") - out, err := cmd.Output() - - if err != nil { - return false, err - } - - return len(out) > 0, nil -}