|
48 | 48 | "Godeps/", "tests/files/", "build/",
|
49 | 49 | // don't relicense vendored sources
|
50 | 50 | "crypto/sha3/", "crypto/ecies/", "logger/glog/",
|
51 |
| - "crypto/curve.go", |
| 51 | + "crypto/secp256k1/curve.go", |
52 | 52 | "trie/arc.go",
|
53 | 53 | }
|
54 | 54 |
|
@@ -151,14 +151,24 @@ func main() {
|
151 | 151 | writeLicenses(infoc)
|
152 | 152 | }
|
153 | 153 |
|
| 154 | +func skipFile(path string) bool { |
| 155 | + if strings.Contains(path, "/testdata/") { |
| 156 | + return true |
| 157 | + } |
| 158 | + for _, p := range skipPrefixes { |
| 159 | + if strings.HasPrefix(path, p) { |
| 160 | + return true |
| 161 | + } |
| 162 | + } |
| 163 | + return false |
| 164 | +} |
| 165 | + |
154 | 166 | func getFiles() []string {
|
155 | 167 | cmd := exec.Command("git", "ls-tree", "-r", "--name-only", "HEAD")
|
156 | 168 | var files []string
|
157 | 169 | err := doLines(cmd, func(line string) {
|
158 |
| - for _, p := range skipPrefixes { |
159 |
| - if strings.HasPrefix(line, p) { |
160 |
| - return |
161 |
| - } |
| 170 | + if skipFile(line) { |
| 171 | + return |
162 | 172 | }
|
163 | 173 | ext := filepath.Ext(line)
|
164 | 174 | for _, wantExt := range extensions {
|
@@ -283,7 +293,7 @@ func getInfo(files <-chan string, out chan<- *info, wg *sync.WaitGroup) {
|
283 | 293 | // fileInfo finds the lowest year in which the given file was commited.
|
284 | 294 | func fileInfo(file string) (*info, error) {
|
285 | 295 | info := &info{file: file, Year: int64(time.Now().Year())}
|
286 |
| - cmd := exec.Command("git", "log", "--follow", "--find-copies", "--pretty=format:%ai", "--", file) |
| 296 | + cmd := exec.Command("git", "log", "--follow", "--find-renames=80", "--find-copies=80", "--pretty=format:%ai", "--", file) |
287 | 297 | err := doLines(cmd, func(line string) {
|
288 | 298 | y, err := strconv.ParseInt(line[:4], 10, 64)
|
289 | 299 | if err != nil {
|
|
0 commit comments