File: disable-test-with-unreliable-tilde-expansion.patch

package info (click to toggle)
golang-github-go-git-go-git 5.16.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,684 kB
  • sloc: makefile: 81; sh: 76
file content (70 lines) | stat: -rw-r--r-- 2,305 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
From: Maytham Alsudany <maytha8thedev@gmail.com>
Description: disable test with unreliable tilde expansion

--- a/plumbing/format/gitignore/dir_test.go
+++ b/plumbing/format/gitignore/dir_test.go
@@ -2,9 +2,7 @@
 
 import (
 	"os"
-	"os/user"
 	"strconv"
-	"strings"
 
 	"github.com/go-git/go-billy/v5"
 	"github.com/go-git/go-billy/v5/memfs"
@@ -15,7 +13,6 @@
 	GFS  billy.Filesystem // git repository root
 	RFS  billy.Filesystem // root that contains user home
 	RFSR billy.Filesystem // root that contains user home, but with relative ~/.gitignore_global
-	RFSU billy.Filesystem // root that contains user home, but with relative ~user/.gitignore_global
 	MCFS billy.Filesystem // root that contains user home, but missing ~/.gitconfig
 	MEFS billy.Filesystem // root that contains user home, but missing excludesfile entry
 	MIFS billy.Filesystem // root that contains user home, but missing .gitignore
@@ -147,37 +144,6 @@
 
 	s.RFSR = fs
 
-	// root that contains user home, but with relative ~user/.gitignore_global
-	fs = memfs.New()
-	err = fs.MkdirAll(home, os.ModePerm)
-	c.Assert(err, IsNil)
-
-	f, err = fs.Create(fs.Join(home, gitconfigFile))
-	c.Assert(err, IsNil)
-	_, err = f.Write([]byte("[core]\n"))
-	c.Assert(err, IsNil)
-	currentUser, err := user.Current()
-	c.Assert(err, IsNil)
-	// remove domain for windows
-	username := currentUser.Username[strings.Index(currentUser.Username, "\\")+1:]
-	_, err = f.Write([]byte("	excludesfile = ~" + username + "/.gitignore_global" + "\n"))
-	c.Assert(err, IsNil)
-	err = f.Close()
-	c.Assert(err, IsNil)
-
-	f, err = fs.Create(fs.Join(home, ".gitignore_global"))
-	c.Assert(err, IsNil)
-	_, err = f.Write([]byte("# IntelliJ\n"))
-	c.Assert(err, IsNil)
-	_, err = f.Write([]byte(".idea/\n"))
-	c.Assert(err, IsNil)
-	_, err = f.Write([]byte("*.iml\n"))
-	c.Assert(err, IsNil)
-	err = f.Close()
-	c.Assert(err, IsNil)
-
-	s.RFSU = fs
-
 	// root that contains user home, but missing ~/.gitconfig
 	fs = memfs.New()
 	err = fs.MkdirAll(home, os.ModePerm)
@@ -289,7 +255,7 @@
 }
 
 func (s *MatcherSuite) TestDir_ReadRelativeGlobalGitIgnore(c *C) {
-	for _, fs := range []billy.Filesystem{s.RFSR, s.RFSU} {
+	for _, fs := range []billy.Filesystem{s.RFSR} {
 		ps, err := LoadGlobalPatterns(fs)
 		c.Assert(err, IsNil)
 		c.Assert(ps, HasLen, 2)