Do not translate zero sha in log title
authorMarco Costalba <[email protected]>
Sat, 13 Jun 2009 11:53:25 +0000 (13 12:53 +0100)
committerMarco Costalba <[email protected]>
Sat, 13 Jun 2009 11:04:11 +0000 (13 13:04 +0200)
In revision log message pane, in bottom left of main
view the sha-ish strings written in the message are,
if possible, transalted to the corresponding revision
title.

This is handy for user that looks at uman readable titles
instead of revision's hex numbers.

This patch teach the transaltion logic to ignore the zero sha
string (40 consecutive '0' chars) because it has normally a
special meaning and we want to keep that instead of transalting
in a non sense like "nothing to commit" or "working dir changes".

Signed-off-by: Marco Costalba <[email protected]>
src/git.cpp

index a20bf0d..8546f6f 100644 (file)
@@ -1307,7 +1307,7 @@ const QString Git::getDesc(SCRef sha, QRegExp& shortLogRE, QRegExp& longLogRE,
 
                SCRef ref = reSHA.cap(0).mid(2);
                const Rev* r = (ref.length() == 40 ? revLookup(ref) : revLookup(getRefSha(ref)));
-               if (r) {
+               if (r && r->sha() != ZERO_SHA_RAW) {
                        QString slog(r->shortLog());
                        if (slog.isEmpty()) // very rare but possible
                                slog = r->sha();