@@ -88,10 +88,11 @@ protected virtual int Initialize()
88
88
/// Clean the input stream and write to the output stream.
89
89
/// </summary>
90
90
/// <param name="path">The path of the file being filtered</param>
91
+ /// <param name="workingDirectory"></param>
91
92
/// <param name="input">The git buf input reader</param>
92
93
/// <param name="output">The git buf output writer</param>
93
94
/// <returns>0 if successful and <see cref="GitErrorCode.PassThrough"/> to skip and pass through</returns>
94
- protected virtual int Clean ( string path , Stream input , Stream output )
95
+ protected virtual int Clean ( string path , string workingDirectory , Stream input , Stream output )
95
96
{
96
97
return ( int ) GitErrorCode . PassThrough ;
97
98
}
@@ -100,10 +101,11 @@ protected virtual int Clean(string path, Stream input, Stream output)
100
101
/// Smudge the input stream and write to the output stream.
101
102
/// </summary>
102
103
/// <param name="path">The path of the file being filtered</param>
104
+ /// <param name="repositoryWorkingDirectory"></param>
103
105
/// <param name="input">The git buf input reader</param>
104
106
/// <param name="output">The git buf output writer</param>
105
107
/// <returns>0 if successful and <see cref="GitErrorCode.PassThrough"/> to skip and pass through</returns>
106
- protected virtual int Smudge ( string path , Stream input , Stream output )
108
+ protected virtual int Smudge ( string path , string repositoryWorkingDirectory , Stream input , Stream output )
107
109
{
108
110
return ( int ) GitErrorCode . PassThrough ;
109
111
}
@@ -188,13 +190,14 @@ int ApplyCallback(GitFilter filter, IntPtr payload,
188
190
IntPtr gitBufferToPtr , IntPtr gitBufferFromPtr , IntPtr filterSourcePtr )
189
191
{
190
192
var filterSource = FilterSource . FromNativePtr ( filterSourcePtr ) ;
193
+ var workingDirectory = filterSource . GetRepositoryWorkingDirectory ( ) ;
191
194
using ( var reader = new GitBufReadStream ( gitBufferFromPtr ) )
192
195
using ( var writer = new GitBufWriteStream ( gitBufferToPtr ) )
193
196
using ( var bufferedWriter = new BufferedStream ( writer ) )
194
197
{
195
198
return filterSource . SourceMode == FilterMode . Clean ?
196
- Clean ( filterSource . Path , reader , bufferedWriter ) :
197
- Smudge ( filterSource . Path , reader , bufferedWriter ) ;
199
+ Clean ( filterSource . Path , workingDirectory , reader , bufferedWriter ) :
200
+ Smudge ( filterSource . Path , workingDirectory , reader , bufferedWriter ) ;
198
201
}
199
202
}
200
203
}
0 commit comments