From 45786d75fc7c9265fb801eee6dd2a75088f50962 Mon Sep 17 00:00:00 2001 From: Martin Date: Wed, 15 Mar 2023 13:21:21 +0100 Subject: [PATCH] fix: Git outputs should be language agnostic. (#126) --- internal/app/install.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/app/install.go b/internal/app/install.go index 302e18e..eab13f8 100644 --- a/internal/app/install.go +++ b/internal/app/install.go @@ -145,8 +145,12 @@ func checkoutSourceCode(baseDir string, gitURL string, version string) string { // Clean the repository logrus.Infof("Resetting %s and pulling latest changes", fullPath) - executeBashCommand("git reset --hard && git clean -d -f -q", fullPath) - executeBashCommand("git remote show origin | sed -n '/HEAD branch/s/.*: //p'| xargs git checkout && git pull", fullPath) + + err = w.Reset(&git.ResetOptions{Mode: git.HardReset}) + CheckIfError(err) + err = w.Clean(&git.CleanOptions{Dir: true}) + CheckIfError(err) + executeBashCommand("LC_ALL=C git remote show origin | sed -n '/HEAD branch/s/.*: //p'| xargs git checkout && git pull", fullPath) if len(version) > 0 { logrus.Infof("Checking out %s", version)