From 2380b7dfbc8640a2f0fdfdb43f8d30245487e741 Mon Sep 17 00:00:00 2001 From: John Cai Date: Thu, 31 Mar 2022 17:08:53 -0400 Subject: localrepo: Fallback to objects directory --- internal/git/localrepo/paths.go | 2 +- internal/git/localrepo/paths_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/git/localrepo/paths.go b/internal/git/localrepo/paths.go index 0c6e32ada..553f150f2 100644 --- a/internal/git/localrepo/paths.go +++ b/internal/git/localrepo/paths.go @@ -24,7 +24,7 @@ func (repo *Repo) ObjectDirectoryPath() (string, error) { objectDirectoryPath := repo.GetGitObjectDirectory() if objectDirectoryPath == "" { - return "", helper.ErrInvalidArgumentf("object directory path is not set") + objectDirectoryPath = "objects" } // We need to check whether the relative object directory as given by the repository is diff --git a/internal/git/localrepo/paths_test.go b/internal/git/localrepo/paths_test.go index 290690a08..3f6a033ea 100644 --- a/internal/git/localrepo/paths_test.go +++ b/internal/git/localrepo/paths_test.go @@ -82,7 +82,7 @@ func TestRepo_ObjectDirectoryPath(t *testing.T) { { desc: "no GitObjectDirectoryPath", repo: repoProto, - err: codes.InvalidArgument, + path: filepath.Join(repoPath, "objects/"), }, { desc: "with directory traversal", -- cgit v1.2.3