Staging
v0.5.2
https://github.com/git/git
Revision fedc7d5458bd8e2e9589567041228a24a8d7eb4c authored by Nicolas Pitre on 16 July 2008, 06:31:39 UTC, committed by Junio C Hamano on 16 July 2008, 16:33:29 UTC
This allows for pack index v2 to be used.  On 32-bit machines the
maximum pack size is 2GB.  To lift this limitation just use a newer
git version.

(based on commit 74e34e1fca2ed9998581cc94073bc2dd28bbb8f3)

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 3339e9f
Raw File
Tip revision: fedc7d5458bd8e2e9589567041228a24a8d7eb4c authored by Nicolas Pitre on 16 July 2008, 06:31:39 UTC
sha1_file.c: learn about index version 2
Tip revision: fedc7d5
usage.c
/*
 * GIT - The information manager from hell
 *
 * Copyright (C) Linus Torvalds, 2005
 */
#include "git-compat-util.h"

static void report(const char *prefix, const char *err, va_list params)
{
	fputs(prefix, stderr);
	vfprintf(stderr, err, params);
	fputs("\n", stderr);
}

static NORETURN void usage_builtin(const char *err)
{
	fprintf(stderr, "usage: %s\n", err);
	exit(129);
}

static NORETURN void die_builtin(const char *err, va_list params)
{
	report("fatal: ", err, params);
	exit(128);
}

static void error_builtin(const char *err, va_list params)
{
	report("error: ", err, params);
}


/* If we are in a dlopen()ed .so write to a global variable would segfault
 * (ugh), so keep things static. */
static void (*usage_routine)(const char *err) NORETURN = usage_builtin;
static void (*die_routine)(const char *err, va_list params) NORETURN = die_builtin;
static void (*error_routine)(const char *err, va_list params) = error_builtin;

void set_usage_routine(void (*routine)(const char *err) NORETURN)
{
	usage_routine = routine;
}

void set_die_routine(void (*routine)(const char *err, va_list params) NORETURN)
{
	die_routine = routine;
}

void set_error_routine(void (*routine)(const char *err, va_list params))
{
	error_routine = routine;
}


void usage(const char *err)
{
	usage_routine(err);
}

void die(const char *err, ...)
{
	va_list params;

	va_start(params, err);
	die_routine(err, params);
	va_end(params);
}

int error(const char *err, ...)
{
	va_list params;

	va_start(params, err);
	error_routine(err, params);
	va_end(params);
	return -1;
}
back to top