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
fetch.h
#ifndef PULL_H
#define PULL_H

/*
 * Fetch object given SHA1 from the remote, and store it locally under
 * GIT_OBJECT_DIRECTORY.  Return 0 on success, -1 on failure.  To be
 * provided by the particular implementation.
 */
extern int fetch(unsigned char *sha1);

/*
 * Fetch the specified object and store it locally; fetch() will be
 * called later to determine success. To be provided by the particular
 * implementation.
 */
extern void prefetch(unsigned char *sha1);

/*
 * Fetch ref (relative to $GIT_DIR/refs) from the remote, and store
 * the 20-byte SHA1 in sha1.  Return 0 on success, -1 on failure.  To
 * be provided by the particular implementation.
 */
extern int fetch_ref(char *ref, unsigned char *sha1);

/* Set to fetch the target tree. */
extern int get_tree;

/* Set to fetch the commit history. */
extern int get_history;

/* Set to fetch the trees in the commit history. */
extern int get_all;

/* Set to be verbose */
extern int get_verbosely;

/* Set to check on all reachable objects. */
extern int get_recover;

/* Report what we got under get_verbosely */
extern void pull_say(const char *, const char *);

/* Load pull targets from stdin */
extern int pull_targets_stdin(char ***target, const char ***write_ref);

/* Free up loaded targets */
extern void pull_targets_free(int targets, char **target, const char **write_ref);

/* If write_ref is set, the ref filename to write the target value to. */
/* If write_ref_log_details is set, additional text will appear in the ref log. */
extern int pull(int targets, char **target, const char **write_ref,
		const char *write_ref_log_details);

#endif /* PULL_H */
back to top