summaryrefslogtreecommitdiff
path: root/builtin-fetch--tool.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-04-28 07:15:48 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-04-29 08:33:13 (GMT)
commit4e6380e5c3af2d8cea8ffac2a7759b4f4e62089b (patch)
treefb09c2cc416d118c59e0f21668391e56d0c8e267 /builtin-fetch--tool.c
parent5b5fe9a526e3841ff6f61dda743b9624dc8f6426 (diff)
downloadgit-4e6380e5c3af2d8cea8ffac2a7759b4f4e62089b.zip
git-4e6380e5c3af2d8cea8ffac2a7759b4f4e62089b.tar.gz
git-4e6380e5c3af2d8cea8ffac2a7759b4f4e62089b.tar.bz2
Do not barf on too long action description
Reflog message is primarily about easier identification, and leaving truncated entry is much better than dying. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-fetch--tool.c')
-rw-r--r--builtin-fetch--tool.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c
index e9d6764..2ad45dc 100644
--- a/builtin-fetch--tool.c
+++ b/builtin-fetch--tool.c
@@ -35,16 +35,13 @@ static int update_ref(const char *action,
unsigned char *sha1,
unsigned char *oldval)
{
- int len;
char msg[1024];
char *rla = getenv("GIT_REFLOG_ACTION");
static struct ref_lock *lock;
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;