Skip to contentSkip to conversation

Do not barf on too long action description

PATCH Junio C Hamano 1 participant 1 message Jun 15, 2016 5 messages not in the archive

lore
Share & tools
lore
#5 lore raw
In reply to a message not in the archive

Reflog message is primarily about easier identification, and leaving truncated entry is much better than dying.

---
 builtin-fetch--tool.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
builtin-fetch--tool.c +1 -3
index 3145c01..1b04881 100644
@@ -42,9 +42,7 @@ static int update_ref(const char *action,
 
 	if (!rla)
 		rla = "(reflog update)";
-	len = snprintf(msg, sizeof(msg), "%s: %s", rla, action);
-	if (sizeof(msg) <= len)
-		die("insanely long action");
+	snprintf(msg, sizeof(msg), "%s: %s", rla, action);
 	lock = lock_any_ref_for_update(refname, oldval);
 	if (!lock)
 		return 1;