Ignore content files ending in ~
authorAsk Bjørn Hansen <ask@develooper.com>
Fri, 28 Feb 2014 05:26:17 +0000 (21:26 -0800)
committerspf13 <steve.francia@gmail.com>
Sat, 1 Mar 2014 04:23:59 +0000 (23:23 -0500)
Also add *~ to .gitignore

.gitignore
source/filesystem.go

index df079f250b04960966696e440f59afb62b5142af..297d8d81568456e2935e7d8acb664e9b31691791 100644 (file)
@@ -4,3 +4,4 @@ hugo.exe
 *.swp\r
 *.swo\r
 .DS_Store\r
+*~\r
index cefe4a950fc15643798ac8cf7840428f2ce81fee..96853c8ddca03c3afdf1109caf0379a902c2bd95 100644 (file)
@@ -117,5 +117,14 @@ func (f *Filesystem) avoid(filePath string) bool {
 }
 
 func ignoreDotFile(filePath string) bool {
-       return filepath.Base(filePath)[0] == '.'
+       base := filepath.Base(filePath)
+       if base[0] == '.' {
+               return true
+       }
+
+       if base[len(base)-1] == '~' {
+               return true
+       }
+
+       return false
 }