mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Backport #15338 More recent versions of git have increased support for detection of renames meaning that a rename with diff changes is now supported. Although ParsePatch supports this - our templates do not and the simplest solution is simply to show the diff. Fix #15335 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
		@@ -57,14 +57,12 @@
 | 
				
			|||||||
				<div class="diff-file-box diff-box file-content">
 | 
									<div class="diff-file-box diff-box file-content">
 | 
				
			||||||
					<h4 class="ui top attached normal header rounded">
 | 
										<h4 class="ui top attached normal header rounded">
 | 
				
			||||||
						<div class="diff-counter count ui left">
 | 
											<div class="diff-counter count ui left">
 | 
				
			||||||
							{{if not $file.IsRenamed}}
 | 
					 | 
				
			||||||
							<span class="add" data-line="{{.Addition}}">+ {{.Addition}}</span>
 | 
												<span class="add" data-line="{{.Addition}}">+ {{.Addition}}</span>
 | 
				
			||||||
							<span class="bar">
 | 
												<span class="bar">
 | 
				
			||||||
								<div class="pull-left add"></div>
 | 
													<div class="pull-left add"></div>
 | 
				
			||||||
								<div class="pull-left del"></div>
 | 
													<div class="pull-left del"></div>
 | 
				
			||||||
							</span>
 | 
												</span>
 | 
				
			||||||
							<span class="del" data-line="{{.Deletion}}">- {{.Deletion}}</span>
 | 
												<span class="del" data-line="{{.Deletion}}">- {{.Deletion}}</span>
 | 
				
			||||||
							{{end}}
 | 
					 | 
				
			||||||
						</div>
 | 
											</div>
 | 
				
			||||||
						<span class="file">{{$file.Name}}</span>
 | 
											<span class="file">{{$file.Name}}</span>
 | 
				
			||||||
						<div>{{$.i18n.Tr "repo.diff.file_suppressed"}}</div>
 | 
											<div>{{$.i18n.Tr "repo.diff.file_suppressed"}}</div>
 | 
				
			||||||
@@ -97,7 +95,7 @@
 | 
				
			|||||||
						<div class="diff-counter count">
 | 
											<div class="diff-counter count">
 | 
				
			||||||
							{{if $file.IsBin}}
 | 
												{{if $file.IsBin}}
 | 
				
			||||||
								{{$.i18n.Tr "repo.diff.bin"}}
 | 
													{{$.i18n.Tr "repo.diff.bin"}}
 | 
				
			||||||
							{{else if not $file.IsRenamed}}
 | 
												{{else}}
 | 
				
			||||||
								<span class="add" data-line="{{.Addition}}">+ {{.Addition}}</span>
 | 
													<span class="add" data-line="{{.Addition}}">+ {{.Addition}}</span>
 | 
				
			||||||
								<span class="bar">
 | 
													<span class="bar">
 | 
				
			||||||
									<div class="pull-left add"></div>
 | 
														<div class="pull-left add"></div>
 | 
				
			||||||
@@ -119,7 +117,6 @@
 | 
				
			|||||||
						{{end}}
 | 
											{{end}}
 | 
				
			||||||
					</h4>
 | 
										</h4>
 | 
				
			||||||
					<div class="diff-file-body ui attached unstackable table segment">
 | 
										<div class="diff-file-body ui attached unstackable table segment">
 | 
				
			||||||
						{{if ne $file.Type 4}}
 | 
					 | 
				
			||||||
						<div class="file-body file-code has-context-menu code-diff {{if $.IsSplitStyle}}code-diff-split{{else}}code-diff-unified{{end}}">
 | 
											<div class="file-body file-code has-context-menu code-diff {{if $.IsSplitStyle}}code-diff-split{{else}}code-diff-unified{{end}}">
 | 
				
			||||||
							<table class="chroma">
 | 
												<table class="chroma">
 | 
				
			||||||
								<tbody>
 | 
													<tbody>
 | 
				
			||||||
@@ -250,7 +247,6 @@
 | 
				
			|||||||
								</tbody>
 | 
													</tbody>
 | 
				
			||||||
							</table>
 | 
												</table>
 | 
				
			||||||
						</div>
 | 
											</div>
 | 
				
			||||||
						{{end}}
 | 
					 | 
				
			||||||
					</div>
 | 
										</div>
 | 
				
			||||||
				</div>
 | 
									</div>
 | 
				
			||||||
			{{end}}
 | 
								{{end}}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user