瀏覽代碼

DisableSymlinks -> !SymlinksEnabled

Jakob Borg 11 年之前
父節點
當前提交
e7441ff6e8

+ 1 - 1
cmd/syncthing/main.go

@@ -458,7 +458,7 @@ func syncthingMain() {
 
 	opts := cfg.Options()
 
-	if opts.DisableSymlinks {
+	if !opts.SymlinksEnabled {
 		symlinks.Supported = false
 	}
 

+ 1 - 1
internal/config/config.go

@@ -179,7 +179,7 @@ type OptionsConfiguration struct {
 	KeepTemporariesH        int      `xml:"keepTemporariesH" default:"24"`     // 0 for off
 	CacheIgnoredFiles       bool     `xml:"cacheIgnoredFiles" default:"true"`
 	ProgressUpdateIntervalS int      `xml:"progressUpdateIntervalS" default:"5"`
-	DisableSymlinks         bool     `xml:"disableSymlinks" default:"false"`
+	SymlinksEnabled         bool     `xml:"symlinksEnabled" default:"true"`
 
 	Deprecated_RescanIntervalS int    `xml:"rescanIntervalS,omitempty" json:"-"`
 	Deprecated_UREnabled       bool   `xml:"urEnabled,omitempty" json:"-"`

+ 2 - 2
internal/config/config_test.go

@@ -53,7 +53,7 @@ func TestDefaultValues(t *testing.T) {
 		KeepTemporariesH:        24,
 		CacheIgnoredFiles:       true,
 		ProgressUpdateIntervalS: 5,
-		DisableSymlinks:         false,
+		SymlinksEnabled:         true,
 	}
 
 	cfg := New(device1)
@@ -156,7 +156,7 @@ func TestOverriddenValues(t *testing.T) {
 		KeepTemporariesH:        48,
 		CacheIgnoredFiles:       false,
 		ProgressUpdateIntervalS: 10,
-		DisableSymlinks:         true,
+		SymlinksEnabled:         false,
 	}
 
 	cfg, err := Load("testdata/overridenvalues.xml", device1)

+ 1 - 1
internal/config/testdata/overridenvalues.xml

@@ -20,6 +20,6 @@
         <keepTemporariesH>48</keepTemporariesH>
         <cacheIgnoredFiles>false</cacheIgnoredFiles>
         <progressUpdateIntervalS>10</progressUpdateIntervalS>
-        <disableSymlinks>true</disableSymlinks>
+        <symlinksEnabled>false</symlinksEnabled>
     </options>
 </configuration>

+ 4 - 4
internal/model/progressemitter_test.go

@@ -31,15 +31,15 @@ func expectEvent(w *events.Subscription, t *testing.T, size int) {
 		t.Fatal("Unexpected error:", err)
 	}
 	if event.Type != events.DownloadProgress {
-		t.Fatal("Unexpected event:", event)		
+		t.Fatal("Unexpected event:", event)
 	}
 	data := event.Data.(map[string]map[string]*pullerProgress)
 	if len(data) != size {
-		t.Fatal("Unexpected event data size:", data)				
+		t.Fatal("Unexpected event data size:", data)
 	}
 }
 
-func expectTimeout(w *events.Subscription, t *testing.T){
+func expectTimeout(w *events.Subscription, t *testing.T) {
 	_, err := w.Poll(timeout)
 	if err != events.ErrTimeout {
 		t.Fatal("Unexpected non-Timeout error:", err)
@@ -78,7 +78,7 @@ func TestProgressEmitter(t *testing.T) {
 	expectTimeout(w, t)
 
 	s.pullStarted()
-	
+
 	expectEvent(w, t, 1)
 	expectTimeout(w, t)
 

+ 1 - 0
test/h2/config.xml

@@ -429,6 +429,7 @@
         <apikey>abc123</apikey>
     </gui>
     <options>
+	    <disableSymlinks>true</disableSymlinks>
         <listenAddress>127.0.0.1:22002</listenAddress>
         <globalAnnounceServer>announce.syncthing.net:22026</globalAnnounceServer>
         <globalAnnounceEnabled>false</globalAnnounceEnabled>