* Empty temp files in the .git/objects subdirectories
@ 2005-11-04 0:56 walt
2005-11-04 1:54 ` Nick Hengeveld
0 siblings, 1 reply; 3+ messages in thread
From: walt @ 2005-11-04 0:56 UTC (permalink / raw)
To: git
I've noticed (sometimes) after using cg-update to
pull from Linus's kernel tree, that I have multiple
empty files named *.temp in the various subdirectories
of .git/objects/.
These *.temp files don't exist in Linus's repository
on kernel.org, so I am assuming they must be created
locally at my end by either cogito or git (dunno which).
They cause no problems except for annoying warning
messages, for example, while doing a git-fsck-*.
I'm using git and cogito(HEAD), both updated by using
cg-update from their git repositories on kernel.org,
so I'm current up to the very last minute :o)
Any suggestions how I can discover who is leaving
behind all these spurious empty *.temp files?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Empty temp files in the .git/objects subdirectories
2005-11-04 0:56 Empty temp files in the .git/objects subdirectories walt
@ 2005-11-04 1:54 ` Nick Hengeveld
2005-11-04 2:32 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Nick Hengeveld @ 2005-11-04 1:54 UTC (permalink / raw)
To: walt; +Cc: git
On Thu, Nov 03, 2005 at 04:56:58PM -0800, walt wrote:
> I've noticed (sometimes) after using cg-update to
> pull from Linus's kernel tree, that I have multiple
> empty files named *.temp in the various subdirectories
> of .git/objects/.
These are created by git-http-fetch to hold data as it's being
fetch from the remote repository. They are left behind after a transfer
error so that the next time git-http-fetch runs it can pick up where it
left off. If they're empty though, it would make more sense to delete
them rather than leaving them behind for the next attempt.
This should fix it:
[PATCH] Remove the temp file if it is empty after the request has failed
Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
---
http-fetch.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
applies-to: 55caf3fd962e3b5a25ee12e09c781e6f5a240672
28738a32636e9f0a326f5d9e662df1e6c594851f
diff --git a/http-fetch.c b/http-fetch.c
index a1b03cd..b12779d 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -520,12 +520,17 @@ static void start_request(struct transfe
static void finish_request(struct transfer_request *request)
{
+ struct stat st;
+
fchmod(request->local, 0444);
close(request->local);
if (request->http_code == 416) {
fprintf(stderr, "Warning: requested range invalid; we may already have all the data.\n");
} else if (request->curl_result != CURLE_OK) {
+ if (stat(request->tmpfile, &st) == 0)
+ if (st.st_size == 0)
+ unlink(request->tmpfile);
return;
}
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: Empty temp files in the .git/objects subdirectories
2005-11-04 1:54 ` Nick Hengeveld
@ 2005-11-04 2:32 ` Junio C Hamano
0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2005-11-04 2:32 UTC (permalink / raw)
To: Nick Hengeveld; +Cc: git
Nick Hengeveld <nickh@reactrix.com> writes:
> These are created by git-http-fetch to hold data as it's being
> fetch from the remote repository. They are left behind after a transfer
> error so that the next time git-http-fetch runs it can pick up where it
> left off. If they're empty though, it would make more sense to delete
> them rather than leaving them behind for the next attempt.
That makes sense. Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-11-04 2:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-04 0:56 Empty temp files in the .git/objects subdirectories walt
2005-11-04 1:54 ` Nick Hengeveld
2005-11-04 2:32 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).