Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 352984

Summary: CommitCommand setCommitter() and setAuthor() methods don't handle null values
Product: [Technology] JGit Reporter: Piotr Janik <janikpiotrek>
Component: JGitAssignee: Matthias Sohn <matthias.sohn>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: matthias.sohn, robin, sop, tomasz.zarna
Version: 1.1   
Target Milestone: 2.2-M1   
Hardware: PC   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 393054    

Description Piotr Janik CLA 2011-07-25 05:30:02 EDT
Build Identifier: 

setCommitter(String name, String email) doc:
"Sets the committer for this commit. If no committer is explicitly specified because this method is never called or called with null value then the committer will be deduced from config info in repository, with current time."
setAuthor(String name, String email) doc:
"Sets the author for this commit. If no author is explicitly specified because this method is never called or called with null value then the author will be set to the committer."

However, passing null values results in committer/author name and email set to "null".

Reproducible: Always
Comment 1 Robin Stocker CLA 2012-10-13 12:43:36 EDT
The other setAuthor/setCommitter methods behave as documented, but the ones with separate name and e-mail arguments don't.

Pushed a change to fix the documentation and explicitly disallow null arguments to PersonIdent:

https://git.eclipse.org/r/8191
Comment 2 Shawn Pearce CLA 2012-10-25 17:19:50 EDT
Committed 6dadc801bdd8e2715e7351f1279ef3b3d59763cc