Staging
v0.5.2
https://github.com/git/git
Revision 3b97fee23df7ec78eea77151fcc0885ec3191950 authored by Eric Wong on 11 January 2007, 21:43:40 UTC, committed by Junio C Hamano on 11 January 2007, 22:49:45 UTC
Unfortunately, while {read,write}_in_full do take into account
zero-sized reads/writes; their die and whine variants do not.

I have a repository where there are zero-sized files in
the history that was triggering these things.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 9130ac1
Raw File
Tip revision: 3b97fee23df7ec78eea77151fcc0885ec3191950 authored by Eric Wong on 11 January 2007, 21:43:40 UTC
Avoid errors and warnings when attempting to do I/O on zero bytes
Tip revision: 3b97fee
update-server-info.c
#include "cache.h"

static const char update_server_info_usage[] =
"git-update-server-info [--force]";

int main(int ac, char **av)
{
	int i;
	int force = 0;
	for (i = 1; i < ac; i++) {
		if (av[i][0] == '-') {
			if (!strcmp("--force", av[i]) ||
			    !strcmp("-f", av[i]))
				force = 1;
			else
				usage(update_server_info_usage);
		}
	}
	if (i != ac)
		usage(update_server_info_usage);

	setup_git_directory();

	return !!update_server_info(force);
}
back to top