Skip to content

Commit 0b4bd07

Browse files
committed
replace "git checkout" by "git reset"
1 parent b27fde2 commit 0b4bd07

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ elif [ ! -d "/repo" ]; then
1717
fi
1818

1919
/git-log-exec --directory ${REPO_DIRECTORY} "$@"
20-
cat out.csv
20+
cat out.csv

git.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func getCommits(limit int, after string, before string) ([]entry, error) {
3838
if line == "" {
3939
continue
4040
}
41-
if i%stepSize != 0 {
41+
if i%stepSize != 0 && i != len(lines)-1 { // include every X once + the last one for sure
4242
continue
4343
}
4444
parts := strings.Split(strings.ReplaceAll(line, `"`, ""), " ")

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func evaluate(commit entry, command string) (entry, error) {
6262
if _, err := execute("git", "clean", "-d", "-f"); err != nil {
6363
return commit, err
6464
}
65-
if _, err := execute("git", "checkout", commit.commit); err != nil {
65+
if _, err := execute("git", "reset", "--hard", commit.commit); err != nil {
6666
return commit, err
6767
}
6868

0 commit comments

Comments
 (0)