diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-10-19 14:52:33 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-10-19 17:09:47 +0300 |
commit | fdcad2a1e5c6b8803c6b42a0c253f5b27aab307a (patch) | |
tree | 43b19d958267986318e7e904bae6cc3efe914478 | |
parent | d27a8b6da9bb40e6f3864b1c59c6247317621d91 (diff) |
git/stats: Inline `hasBitmap()` helper function
Inline the `hasBitmap()` helper functon into the public `HasBitmap()`
function. They both do the same, and the internal helper is not used by
anything.
-rw-r--r-- | internal/git/stats/profile.go | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/internal/git/stats/profile.go b/internal/git/stats/profile.go index 86067a0a3..44cb007d7 100644 --- a/internal/git/stats/profile.go +++ b/internal/git/stats/profile.go @@ -12,11 +12,12 @@ import ( // HasBitmap returns whether or not the repository contains an object bitmap. func HasBitmap(repoPath string) (bool, error) { - hasBitmap, err := hasBitmap(repoPath) + bitmaps, err := filepath.Glob(filepath.Join(repoPath, "objects", "pack", "*.bitmap")) if err != nil { return false, err } - return hasBitmap, nil + + return len(bitmaps) > 0, nil } // PackfilesCount returns the number of packfiles a repository has. @@ -68,12 +69,3 @@ func LooseObjects(ctx context.Context, repo git.RepositoryExecutor) (int64, erro return count, nil } - -func hasBitmap(repoPath string) (bool, error) { - bitmaps, err := filepath.Glob(filepath.Join(repoPath, "objects", "pack", "*.bitmap")) - if err != nil { - return false, err - } - - return len(bitmaps) > 0, nil -} |