@@ -97,17 +97,17 @@ func (r *Repository) RawDiff(rev string, diffType RawDiffFormat, w io.Writer, op
97
97
switch diffType {
98
98
case RawDiffNormal :
99
99
if commit .ParentsCount () == 0 {
100
- cmd .AddArgs ("show" , rev )
100
+ cmd .AddArgs ("show" , "--full-index" , rev )
101
101
} else {
102
102
c , _ := commit .Parent (0 )
103
- cmd .AddArgs ("diff" , "-M" , c .ID .String (), rev )
103
+ cmd .AddArgs ("diff" , "--full-index" , "- M" , c .ID .String (), rev )
104
104
}
105
105
case RawDiffPatch :
106
106
if commit .ParentsCount () == 0 {
107
- cmd .AddArgs ("format-patch" , "--no-signature" , "--stdout" , "--root" , rev )
107
+ cmd .AddArgs ("format-patch" , "--full-index" , "-- no-signature" , "--stdout" , "--root" , rev )
108
108
} else {
109
109
c , _ := commit .Parent (0 )
110
- cmd .AddArgs ("format-patch" , "--no-signature" , "--stdout" , rev + "..." + c .ID .String ())
110
+ cmd .AddArgs ("format-patch" , "--full-index" , "-- no-signature" , "--stdout" , rev + "..." + c .ID .String ())
111
111
}
112
112
default :
113
113
return fmt .Errorf ("invalid diffType: %s" , diffType )
@@ -135,5 +135,5 @@ func (r *Repository) DiffBinary(base, head string, opts ...DiffBinaryOptions) ([
135
135
opt = opts [0 ]
136
136
}
137
137
138
- return NewCommand ("diff" , "--binary" , base , head ).RunInDirWithTimeout (opt .Timeout , r .path )
138
+ return NewCommand ("diff" , "--full-index" , "-- binary" , base , head ).RunInDirWithTimeout (opt .Timeout , r .path )
139
139
}
0 commit comments