From cdaf0dc75245a1ddf8292190238a273d54ca9fe8 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Wed, 17 Jan 2024 18:16:33 +0800 Subject: [PATCH] Remove duplicated checkinit on git module (#28824) (#28831) Backport #28824 by @lunny `checkInit` has been invoked in `InitSimple`. So it's unnecessary to invoke it twice in `InitFull`. Co-authored-by: Lunny Xiao (cherry picked from commit 8b5c9186a54b2e177fc58295ecd83bfc4700cbfd) --- modules/git/git.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/git/git.go b/modules/git/git.go index 12d2f94e51..5ace1dfb56 100644 --- a/modules/git/git.go +++ b/modules/git/git.go @@ -166,10 +166,6 @@ func InitSimple(ctx context.Context) error { // InitFull initializes git module with version check and change global variables, sync gitconfig. // It should only be called once at the beginning of the program initialization (TestMain/GlobalInitInstalled) as this code makes unsynchronized changes to variables. func InitFull(ctx context.Context) (err error) { - if err = checkInit(); err != nil { - return err - } - if err = InitSimple(ctx); err != nil { return err }