diff options
Diffstat (limited to 'object-name.c')
| -rw-r--r-- | object-name.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/object-name.c b/object-name.c index e225eb602c..ddafe7f9b1 100644 --- a/object-name.c +++ b/object-name.c @@ -1081,13 +1081,17 @@ static int get_oid_basic(struct repository *r, const char *str, int len, * still fill in the oid with the "old" value, * which we can use. */ - } else { + } else if (!(flags & GET_OID_GENTLY)) { if (flags & GET_OID_QUIETLY) { exit(128); } die(_("log for '%.*s' only has %d entries"), len, str, co_cnt); } + if (flags & GET_OID_GENTLY) { + free(real_ref); + return -1; + } } } |
