Grrr, workaround the fact that one can not commit "000" files.
authorOllivier Robert <roberto@keltia.net>
Mon, 10 Apr 2017 20:01:45 +0200
changeset 47 4ea0a1d2cf9a
parent 46 d25fab59ded9
child 48 2124c16bd397
Grrr, workaround the fact that one can not commit "000" files.
config_test.go
--- a/config_test.go	Mon Apr 10 19:57:45 2017 +0200
+++ b/config_test.go	Mon Apr 10 20:01:45 2017 +0200
@@ -4,6 +4,7 @@
 	"testing"
 	"github.com/stretchr/testify/assert"
 	"path/filepath"
+	"os"
 )
 
 func TestLoadGlobal(t *testing.T) {
@@ -12,8 +13,11 @@
 	_, err := loadGlobal(filepath.Join("test", "non.toml"))
 	assert.Error(t, err, "does not exist")
 
+	// git does now allow you to checkin 000 files :(
+	err = os.Chmod(filepath.Join("test", "perms.toml"), 000)
 	_, err = loadGlobal(filepath.Join("test", "perms.toml"))
 	assert.Error(t, err, "unreadable")
+	err = os.Chmod(filepath.Join("test", "perms.toml"), 600)
 
 	c, err := loadGlobal(filepath.Join("test", "config.toml"))
 	assert.NoError(t, err, "should read it fine")