Skip to content

Commit 2c06e05

Browse files
committed
refactor variable name
1 parent c20205c commit 2c06e05

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

modules/git/git.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,16 @@ func initFixGitHome117rc() error {
192192

193193
// remove the empty directories, if some directories are non-empty, warn users and exit
194194
var hasCheckErr bool
195-
for _, wellDirName := range []string{".ssh", ".gnupg"} {
196-
checkLegacyDir := filepath.Join(setting.RepoRootPath, wellDirName)
197-
st, err := os.Lstat(checkLegacyDir) // only process dir or symlink
195+
for _, wellKnownDirName := range []string{".ssh", ".gnupg"} {
196+
legacyDir := filepath.Join(setting.RepoRootPath, wellKnownDirName)
197+
st, err := os.Lstat(legacyDir) // only process dir or symlink
198198
if err != nil || (!st.IsDir() && st.Mode()&os.ModeSymlink != os.ModeSymlink) {
199199
continue
200200
}
201-
_ = os.Remove(checkLegacyDir) // try to remove the empty dummy directory first
202-
_, err = os.Stat(checkLegacyDir) // if the directory is not empty, then it won't be removed, it should be handled manually
201+
_ = os.Remove(legacyDir) // try to remove the empty dummy directory first
202+
_, err = os.Stat(legacyDir) // if the directory is not empty, then it won't be removed, it should be handled manually
203203
if err == nil || !errors.Is(err, os.ErrNotExist) {
204-
log.Error(`Git HOME has been moved to [git].HOME_PATH, but there are legacy file in old place. Please backup and remove the legacy files %q`, checkLegacyDir)
204+
log.Error(`Git HOME has been moved to [git].HOME_PATH, but there are legacy file in old place. Please backup and remove the legacy files %q`, legacyDir)
205205
hasCheckErr = true
206206
}
207207
}

0 commit comments

Comments
 (0)