summaryrefslogtreecommitdiff
path: root/copy.c
Commit message (Collapse)AuthorAgeFilesLines
* preserve mtime of local cloneClemens Buchacher2009-09-131-0/+21
| | | | | | | | | | | | | A local clone without hardlinks copies all objects, including dangling ones, to the new repository. Since the mtimes are renewed, those dangling objects cannot be pruned by "git gc --prune", even if they would have been old enough for pruning in the original repository. Instead, preserve mtime during copy. "git gc --prune" will then work in the clone just like it did in the original. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* copy.c: copy_fd - correctly report write errorsAriel Badichi2008-04-221-4/+4
| | | | | | | | | | Previously, the errno could have been lost due to an intervening close() call. This patch also contains minor cosmetic changes. Signed-off-by: Ariel Badichi <abadichi@bezeqint.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Use a single implementation and API for copy_file()Daniel Barkalow2008-02-251-0/+21
| | | | | | | | Originally by Kristian Hï¿œgsberg; I fixed the conversion of rerere, which had a different API. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* War on whitespaceJunio C Hamano2007-06-071-1/+0
| | | | | | | | | This uses "git-apply --whitespace=strip" to fix whitespace errors that have crept in to our source files over time. There are a few files that need to have trailing whitespaces (most notably, test vectors). The results still passes the test, and build result in Documentation/ area is unchanged. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Ensure return value from xread() is always stored into an ssize_tJohan Herland2007-05-151-2/+1
| | | | | | | | | This patch fixes all calls to xread() where the return value is not stored into an ssize_t. The patch should not have any effect whatsoever, other than putting better/more appropriate type names on variables. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* copy_fd: close ifd on errorSam Ravnborg2005-12-271-2/+5
| | | | | | | In copy_fd when write fails we ought to close input file descriptor. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* xread/xwrite: do not worry about EINTR at calling sites.Junio C Hamano2005-12-191-12/+7
| | | | | | | | | | We had errno==EINTR check after read(2)/write(2) sprinkled all over the places, always doing continue. Consolidate them into xread()/xwrite() wrapper routines. Credits for suggestion goes to HPA -- bugs are mine. Signed-off-by: Junio C Hamano <junkio@cox.net>
* copy.c::copy_fd() - do not leak file descriptor on error return.Junio C Hamano2005-11-051-1/+4
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* pack-objects: Allow use of pre-generated pack.Junio C Hamano2005-10-261-0/+37
git-pack-objects can reuse pack files stored in $GIT_DIR/pack-cache directory, when a necessary pack is found. This is hopefully useful when upload-pack (called from git-daemon) is expected to receive requests for the same set of objects many times (e.g full cloning request of any project, or updates from the set of heads previous day to the latest for a slow moving project). Currently git-pack-objects does *not* keep pack files it creates for reusing. It might be useful to add --update-cache option to it, which would allow it store pack files it created in the pack-cache directory, and prune rarely used ones from it. Signed-off-by: Junio C Hamano <junkio@cox.net>