summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d761b2a)
raw | patch | inline | side by side (parent: d761b2a)
author | Shawn O. Pearce <spearce@spearce.org> | |
Sat, 17 Apr 2010 20:07:36 +0000 (13:07 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 17 Apr 2010 20:55:45 +0000 (13:55 -0700) |
Always remove the struct packed_git from the active list, even
if the rename of the temporary file fails.
While we are here, simplify the code a bit by using a common
local variable name ("p") to hold the relevant packed_git.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
if the rename of the temporary file fails.
While we are here, simplify the code a bit by using a common
local variable name ("p") to hold the relevant packed_git.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http.c | patch | blob | history |
index 9526491a45357d5d80068bac939a4aa7cce9aa91..e9e22695665ec62381ea56b19f8c61ed898e503e 100644 (file)
--- a/http.c
+++ b/http.c
{
int ret;
struct packed_git **lst;
+ struct packed_git *p = preq->target;
- preq->target->pack_size = ftell(preq->packfile);
+ p->pack_size = ftell(preq->packfile);
if (preq->packfile != NULL) {
fclose(preq->packfile);
preq->slot->local = NULL;
}
- ret = move_temp_to_file(preq->tmpfile, preq->filename);
- if (ret)
- return ret;
-
lst = preq->lst;
- while (*lst != preq->target)
+ while (*lst != p)
lst = &((*lst)->next);
*lst = (*lst)->next;
- if (verify_pack(preq->target))
+ ret = move_temp_to_file(preq->tmpfile, preq->filename);
+ if (ret)
+ return ret;
+ if (verify_pack(p))
return -1;
- install_packed_git(preq->target);
+ install_packed_git(p);
return 0;
}