Mercurial > hg
diff hgext/git/gitlog.py @ 44478:6d953b3fc2bd
git: make {shortest()} return shortest *unique* prefix
It used to return the prefix of the specified length as long as the
full node was unique (i.e. always).
Differential Revision: https://phab.mercurial-scm.org/D8256
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 06 Mar 2020 14:14:05 -0800 |
parents | ad718271a9eb |
children | f19491aae641 |
line wrap: on
line diff
--- a/hgext/git/gitlog.py Tue Feb 11 00:44:59 2020 -0500 +++ b/hgext/git/gitlog.py Fri Mar 06 14:14:05 2020 -0800 @@ -170,7 +170,7 @@ matches = int( self._db.execute( 'SELECT COUNT(*) FROM changelog WHERE node LIKE ?', - (pycompat.sysstr(nodehex + b'%'),), + (pycompat.sysstr(candidate + b'%'),), ).fetchone()[0] ) if matches == 1: