Fix: Editing the commit message causes other files to be removed
If the commit message is edited from the UI, a new patch set is created, but it does not contain any of the files that were in the change. This is because when the commit message is edited, the parent revision of the newly created patch set is set to the revision of the patch set that was edited. This is wrong, it should be set to the edited patch set's parent. Change-Id: I7874024dcc7c228c94b7332a857554309c3cb9e0
This commit is contained in:
		
				
					committed by
					
						
						Shawn O. Pearce
					
				
			
			
				
	
			
			
			
						parent
						
							077c18d3bf
						
					
				
				
					commit
					daea4504c0
				
			@@ -340,8 +340,8 @@ public class ChangeUtil {
 | 
				
			|||||||
            user.newCommitterIdent(myIdent.getWhen(), myIdent.getTimeZone());
 | 
					            user.newCommitterIdent(myIdent.getWhen(), myIdent.getTimeZone());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        CommitBuilder commitBuilder = new CommitBuilder();
 | 
					        CommitBuilder commitBuilder = new CommitBuilder();
 | 
				
			||||||
        commitBuilder.addParentId(commit);
 | 
					 | 
				
			||||||
        commitBuilder.setTreeId(commit.getTree());
 | 
					        commitBuilder.setTreeId(commit.getTree());
 | 
				
			||||||
 | 
					        commitBuilder.setParentIds(commit.getParents());
 | 
				
			||||||
        commitBuilder.setAuthor(authorIdent);
 | 
					        commitBuilder.setAuthor(authorIdent);
 | 
				
			||||||
        commitBuilder.setCommitter(myIdent);
 | 
					        commitBuilder.setCommitter(myIdent);
 | 
				
			||||||
        commitBuilder.setMessage(message);
 | 
					        commitBuilder.setMessage(message);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user