Skip to content

Commit 78b3cc4

Browse files
committed
Revert lookup order
Should be slightly faster for large histories.
1 parent 6d6362b commit 78b3cc4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ _testmain.go
2424
*.prof
2525
cover.out
2626
bench.txt
27+
bench2.txt

‎gitmap.go‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func Map(repository, revision string) (GitMap, error) {
3939
m := make(GitMap)
4040

4141
gitLogArgs := fmt.Sprintf(
42-
"-C %s log --name-only --no-merges --reverse --format=format:%%x1e%%H%%x1f%%h%%x1f%%s%%x1f%%aN%%x1f%%aE%%x1f%%ai %s",
42+
"-C %s log --name-only --no-merges --format=format:%%x1e%%H%%x1f%%h%%x1f%%s%%x1f%%aN%%x1f%%aE%%x1f%%ai %s",
4343
repository,
4444
revision,
4545
)
@@ -73,7 +73,9 @@ func Map(repository, revision string) (GitMap, error) {
7373
if filename == "" {
7474
continue
7575
}
76-
m[filename] = gitInfo
76+
if _, ok := m[filename]; !ok {
77+
m[filename] = gitInfo
78+
}
7779
}
7880
}
7981

0 commit comments

Comments
 (0)