Skip to content
This repository was archived by the owner on Apr 12, 2019. It is now read-only.

Commit 0077deb

Browse files
jonasfranzappleboy
authored andcommitted
Fix blame problem for older git versions (#118)
1 parent 622cdd1 commit 0077deb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

repo_blame.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import "fmt"
88

99
// FileBlame return the Blame object of file
1010
func (repo *Repository) FileBlame(revision, path, file string) ([]byte, error) {
11-
return NewCommand("blame", "--root", file).RunInDirBytes(path)
11+
return NewCommand("blame", "--root", "--", file).RunInDirBytes(path)
1212
}
1313

1414
// LineBlame returns the latest commit at the given line
1515
func (repo *Repository) LineBlame(revision, path, file string, line uint) (*Commit, error) {
16-
res, err := NewCommand("blame", fmt.Sprintf("-L %d,%d", line, line), "-p", revision, file).RunInDir(path)
16+
res, err := NewCommand("blame", fmt.Sprintf("-L %d,%d", line, line), "-p", revision, "--", file).RunInDir(path)
1717
if err != nil {
1818
return nil, err
1919
}

0 commit comments

Comments
 (0)