@@ -1453,8 +1453,11 @@ func (r *Repo) BlameRevision(ctx context.Context, rev, path string, start, end i
14531453 return r .blame (ctx , rev , path , start , end , extra ... )
14541454}
14551455
1456+ // blame and log pass --no-textconv first, so a caller can still opt back in:
1457+ // git enables a repository's diff.<driver>.textconv program on both, and
1458+ // rgit reports lines of the real bytes its extents were resolved against.
14561459func (r * Repo ) blame (ctx context.Context , rev , path string , start , end int , extra ... string ) ([]byte , error ) {
1457- args := append ([]string {"blame" , fmt .Sprintf ("-L%d,%d" , start , end )}, extra ... )
1460+ args := append ([]string {"blame" , "--no-textconv" , fmt .Sprintf ("-L%d,%d" , start , end )}, extra ... )
14581461 if rev != "" {
14591462 args = append (args , rev )
14601463 }
@@ -1491,7 +1494,7 @@ func (r *Repo) LogLineRange(ctx context.Context, path string, start, end int, ex
14911494 if strings .ContainsAny (path , ":\n \x00 " ) {
14921495 return nil , & LineRangePathError {Path : path }
14931496 }
1494- args := append ([]string {"log" , fmt .Sprintf ("-L%d,%d:%s" , start , end , path )}, extra ... )
1497+ args := append ([]string {"log" , "--no-textconv" , fmt .Sprintf ("-L%d,%d:%s" , start , end , path )}, extra ... )
14951498 return r .checked (ctx , args ... )
14961499}
14971500
@@ -1552,7 +1555,7 @@ func (r *Repo) FindRename(ctx context.Context, rev, path string) (commit, oldPat
15521555// unparseable date or an unwalkable path is a genuine failure -- so any
15531556// non-zero exit is a *GitError.
15541557func (r * Repo ) Log (ctx context.Context , since , until string , paths []string , extra ... string ) ([]byte , error ) {
1555- args := []string {"log" }
1558+ args := []string {"log" , "--no-textconv" }
15561559 if since != "" {
15571560 args = append (args , "--since=" + since )
15581561 }
0 commit comments