Contributed by græy on from the again and again and again dept.
- fix missing status code of staged files in log message template during commit
- remove empty dangling directories within refs/ when removing references
- do not add unversioned files to version control if a file addition is merged
- handle removal of UID_MAX and GID_MAX
- fix a problem where 'got revert' errors out in work trees with a path-prefix
- plug a memory leak caused by duplicate ignore patterns
