Skip to content

Commit

Permalink
Fix blame problem for older git versions (go-gitea#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasfranz authored and appleboy committed May 17, 2018
1 parent 622cdd1 commit 0077deb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions repo_blame.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import "fmt"

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

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

0 comments on commit 0077deb

Please sign in to comment.