mirror of
				https://github.com/scm-manager/scm-manager.git
				synced 2025-10-31 18:46:07 +01:00 
			
		
		
		
	fix SVN binary diff
This commit is contained in:
		
				
					committed by
					
						 René Pfeuffer
						René Pfeuffer
					
				
			
			
				
	
			
			
			
						parent
						
							6c16b74488
						
					
				
				
					commit
					076d877245
				
			| @@ -565,6 +565,8 @@ public class SCMSvnDiffGenerator implements ISvnDiffGenerator { | ||||
|       } | ||||
|       if (!useGitFormat){ | ||||
|         displayBinary(mimeType1, mimeType2, outputStream, leftIsBinary, rightIsBinary); | ||||
|       } else { | ||||
|         displayBinaryGit(target, operation, outputStream); | ||||
|       } | ||||
|  | ||||
|       return; | ||||
| @@ -590,6 +592,18 @@ public class SCMSvnDiffGenerator implements ISvnDiffGenerator { | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   private void displayBinaryGit(SvnTarget target, SvnDiffCallback.OperationKind operation, OutputStream outputStream) throws SVNException { | ||||
|     String path1 = operation == SvnDiffCallback.OperationKind.Added ? "/dev/null" : getRelativeToRootPath(target, originalTarget1); | ||||
|     String path2 = operation == SvnDiffCallback.OperationKind.Deleted ? "/dev/null" : getRelativeToRootPath(target, originalTarget2); | ||||
|     try { | ||||
|       displayString(outputStream, String.format("--- a/%s\n", path1)); | ||||
|       displayString(outputStream, String.format("+++ b/%s\n", path2)); | ||||
|       displayString(outputStream, "Binary files differ"); | ||||
|     } catch (IOException e) { | ||||
|       wrapException(e); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   private void displayBinary(String mimeType1, String mimeType2, OutputStream outputStream, boolean leftIsBinary, boolean rightIsBinary) throws SVNException { | ||||
|     displayCannotDisplayFileMarkedBinary(outputStream); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user