Staging
v0.5.1
https://github.com/git/git
Revision fc4c4cd21c783b6dc387002c6e018d26f7405e9f authored by Junio C Hamano on 04 April 2006, 21:52:53 UTC, committed by Junio C Hamano on 04 April 2006, 21:52:53 UTC
Bunch of cleanups with a few notable enhancements since
1.3.0-rc1:

 - revision traversal infrastructure is updated so that
   existence of paths limiters and/or --max-age does not cause
   it to call limit_list().  This helps the latency working with
   the command quite a bit.

 - comes with updated gitk.

One notable fix is to make sure that the IO is restarted upon
signal even on platforms whose default signal semantics is not
to do so.  This is the fix for the notorious "clone is broken
since 1.2.2 on Solaris" problem.

Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 3d9c54d
Raw File
Tip revision: fc4c4cd21c783b6dc387002c6e018d26f7405e9f authored by Junio C Hamano on 04 April 2006, 21:52:53 UTC
GIT 1.3.0-rc2
Tip revision: fc4c4cd
unpack-file.c
#include "cache.h"
#include "blob.h"

static char *create_temp_file(unsigned char *sha1)
{
	static char path[50];
	void *buf;
	char type[100];
	unsigned long size;
	int fd;

	buf = read_sha1_file(sha1, type, &size);
	if (!buf || strcmp(type, blob_type))
		die("unable to read blob object %s", sha1_to_hex(sha1));

	strcpy(path, ".merge_file_XXXXXX");
	fd = mkstemp(path);
	if (fd < 0)
		die("unable to create temp-file");
	if (write(fd, buf, size) != size)
		die("unable to write temp-file");
	close(fd);
	return path;
}

int main(int argc, char **argv)
{
	unsigned char sha1[20];

	if (argc != 2 || get_sha1(argv[1], sha1))
		usage("git-unpack-file <sha1>");

	setup_git_directory();
	git_config(git_default_config);

	puts(create_temp_file(sha1));
	return 0;
}
back to top