File: 0001-Skip-TestGitRepoForPath.patch

package info (click to toggle)
golang-github-muesli-gitcha 0.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 112 kB
  • sloc: makefile: 5
file content (19 lines) | stat: -rw-r--r-- 545 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Description: Skip TestGitRepoForPath when .git directory does not exist
 This prevents Debian package build from failing.
Author: Anthony Fok <foka@debian.org>
Origin: vendor
Last-Update: 2021-12-06
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/gitcha_test.go
+++ b/gitcha_test.go
@@ -8,6 +8,9 @@
 )
 
 func TestGitRepoForPath(t *testing.T) {
+	if _, err := os.Stat(".git"); os.IsNotExist(err) {
+		t.Skip("No .git directory, skipping", t.Name())
+	}
 	abs, _ := filepath.Abs(".")
 	tt := []struct {
 		path string