| 1 |
From: Maytham Alsudany <[email protected]> |
| 2 |
Date: Wed, 27 Mar 2024 21:51:36 +0800 |
| 3 |
Subject: Disable gitignore test with unreliable tilde expansion |
| 4 |
|
| 5 |
Disable gitignore test that relies on ~user tilde expansion, which fails |
| 6 |
in isolated Debian build chroots where user home directory lookup is unreliable. |
| 7 |
|
| 8 |
Forwarded: not-needed |
| 9 |
Last-Update: 2024-03-27 |
| 10 |
--- |
| 11 |
plumbing/format/gitignore/dir_test.go | 36 +---------------------------------- |
| 12 |
1 file changed, 1 insertion(+), 35 deletions(-) |
| 13 |
|
| 14 |
diff --git a/plumbing/format/gitignore/dir_test.go b/plumbing/format/gitignore/dir_test.go |
| 15 |
index ba8ad80..a3758d7 100644 |
| 16 |
--- a/plumbing/format/gitignore/dir_test.go |
| 17 |
+++ b/plumbing/format/gitignore/dir_test.go |
| 18 |
@@ -2,9 +2,7 @@ package gitignore |
| 19 |
|
| 20 |
import ( |
| 21 |
"os" |
| 22 |
- "os/user" |
| 23 |
"strconv" |
| 24 |
- "strings" |
| 25 |
|
| 26 |
"github.com/go-git/go-billy/v5" |
| 27 |
"github.com/go-git/go-billy/v5/memfs" |
| 28 |
@@ -15,7 +13,6 @@ type MatcherSuite struct { |
| 29 |
GFS billy.Filesystem // git repository root |
| 30 |
RFS billy.Filesystem // root that contains user home |
| 31 |
RFSR billy.Filesystem // root that contains user home, but with relative ~/.gitignore_global |
| 32 |
- RFSU billy.Filesystem // root that contains user home, but with relative ~user/.gitignore_global |
| 33 |
MCFS billy.Filesystem // root that contains user home, but missing ~/.gitconfig |
| 34 |
MEFS billy.Filesystem // root that contains user home, but missing excludesfile entry |
| 35 |
MIFS billy.Filesystem // root that contains user home, but missing .gitignore |
| 36 |
@@ -160,37 +157,6 @@ func (s *MatcherSuite) SetUpTest(c *C) { |
| 37 |
|
| 38 |
s.RFSR = fs |
| 39 |
|
| 40 |
- // root that contains user home, but with relative ~user/.gitignore_global |
| 41 |
- fs = memfs.New() |
| 42 |
- err = fs.MkdirAll(home, os.ModePerm) |
| 43 |
- c.Assert(err, IsNil) |
| 44 |
- |
| 45 |
- f, err = fs.Create(fs.Join(home, gitconfigFile)) |
| 46 |
- c.Assert(err, IsNil) |
| 47 |
- _, err = f.Write([]byte("[core]\n")) |
| 48 |
- c.Assert(err, IsNil) |
| 49 |
- currentUser, err := user.Current() |
| 50 |
- c.Assert(err, IsNil) |
| 51 |
- // remove domain for windows |
| 52 |
- username := currentUser.Username[strings.Index(currentUser.Username, "\\")+1:] |
| 53 |
- _, err = f.Write([]byte(" excludesfile = ~" + username + "/.gitignore_global" + "\n")) |
| 54 |
- c.Assert(err, IsNil) |
| 55 |
- err = f.Close() |
| 56 |
- c.Assert(err, IsNil) |
| 57 |
- |
| 58 |
- f, err = fs.Create(fs.Join(home, ".gitignore_global")) |
| 59 |
- c.Assert(err, IsNil) |
| 60 |
- _, err = f.Write([]byte("# IntelliJ\n")) |
| 61 |
- c.Assert(err, IsNil) |
| 62 |
- _, err = f.Write([]byte(".idea/\n")) |
| 63 |
- c.Assert(err, IsNil) |
| 64 |
- _, err = f.Write([]byte("*.iml\n")) |
| 65 |
- c.Assert(err, IsNil) |
| 66 |
- err = f.Close() |
| 67 |
- c.Assert(err, IsNil) |
| 68 |
- |
| 69 |
- s.RFSU = fs |
| 70 |
- |
| 71 |
// root that contains user home, but missing ~/.gitconfig |
| 72 |
fs = memfs.New() |
| 73 |
err = fs.MkdirAll(home, os.ModePerm) |
| 74 |
@@ -303,7 +269,7 @@ func (s *MatcherSuite) TestDir_ReadPatterns(c *C) { |
| 75 |
} |
| 76 |
|
| 77 |
func (s *MatcherSuite) TestDir_ReadRelativeGlobalGitIgnore(c *C) { |
| 78 |
- for _, fs := range []billy.Filesystem{s.RFSR, s.RFSU} { |
| 79 |
+ for _, fs := range []billy.Filesystem{s.RFSR} { |
| 80 |
ps, err := LoadGlobalPatterns(fs) |
| 81 |
c.Assert(err, IsNil) |
| 82 |
c.Assert(ps, HasLen, 2) |