Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

123456789101112131415161718192021222324252627
  1. // Copyright 2024 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package git
  4. import (
  5. "path/filepath"
  6. "testing"
  7. "github.com/stretchr/testify/assert"
  8. )
  9. func TestSubTree_Issue29101(t *testing.T) {
  10. repo, err := openRepositoryWithDefaultContext(filepath.Join(testReposDir, "repo1_bare"))
  11. assert.NoError(t, err)
  12. defer repo.Close()
  13. commit, err := repo.GetCommit("ce064814f4a0d337b333e646ece456cd39fab612")
  14. assert.NoError(t, err)
  15. // old code could produce a different error if called multiple times
  16. for i := 0; i < 10; i++ {
  17. _, err = commit.SubTree("file1.txt")
  18. assert.Error(t, err)
  19. assert.True(t, IsErrNotExist(err))
  20. }
  21. }