From a0b612a537f499b2cc9bddafac625e12c73bd3f5 Mon Sep 17 00:00:00 2001 From: Paulo Gomes Date: Fri, 2 Dec 2022 15:38:58 +0000 Subject: [PATCH 1/2] build: Add CI check for CGO_ENABLED=0 Some applications that depend on go-git may not need to build using CGO. The new test ensures no new regressions going forwards. Signed-off-by: Paulo Gomes --- .github/workflows/git.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/git.yml b/.github/workflows/git.yml index fef212763..ba664a2f4 100644 --- a/.github/workflows/git.yml +++ b/.github/workflows/git.yml @@ -38,3 +38,8 @@ jobs: - name: Test run: make test-coverage + + - name: Build go-git with CGO disabled + run: go build ./... + env: + CGO_ENABLED: 0 From 223e7321561147bb4f56e442ca8f84b7453e131e Mon Sep 17 00:00:00 2001 From: Paulo Gomes Date: Sat, 3 Dec 2022 13:19:01 +0000 Subject: [PATCH 2/2] build: Bump github.com/pjbgf/sha1cd to v0.2.3 Fixes regression in which applications that depend on go-git could no longer build with CGO_ENABLED=0 or when vendoring dependencies. Signed-off-by: Paulo Gomes --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b214c8a8d..9a9fa195b 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 github.com/jessevdk/go-flags v1.5.0 github.com/kevinburke/ssh_config v1.2.0 - github.com/pjbgf/sha1cd v0.2.0 + github.com/pjbgf/sha1cd v0.2.3 github.com/pkg/errors v0.9.1 // indirect github.com/sergi/go-diff v1.1.0 github.com/skeema/knownhosts v1.1.0 diff --git a/go.sum b/go.sum index 2c00f0092..35b347b17 100644 --- a/go.sum +++ b/go.sum @@ -45,8 +45,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/pjbgf/sha1cd v0.2.0 h1:gIsJVwjbRviE4gydidGztxH1IlJQoYBcCrwG4Dz8wvM= -github.com/pjbgf/sha1cd v0.2.0/go.mod h1:HOK9QrgzdHpbc2Kzip0Q1yi3M2MFGPADtR6HjG65m5M= +github.com/pjbgf/sha1cd v0.2.3 h1:uKQP/7QOzNtKYH7UTohZLcjF5/55EnTw0jO/Ru4jZwI= +github.com/pjbgf/sha1cd v0.2.3/go.mod h1:HOK9QrgzdHpbc2Kzip0Q1yi3M2MFGPADtR6HjG65m5M= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=