diff options
Diffstat (limited to 'builtin/receive-pack.c')
-rw-r--r-- | builtin/receive-pack.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index cabdc55e09..29a0f3b75f 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -23,6 +23,7 @@ #include "fsck.h" #include "tmp-objdir.h" #include "oidset.h" +#include "packfile.h" static const char * const receive_pack_usage[] = { N_("git receive-pack <git-dir>"), @@ -742,7 +743,7 @@ static int run_and_feed_hook(const char *hook_name, feed_fn feed, size_t n; if (feed(feed_state, &buf, &n)) break; - if (write_in_full(proc.in, buf, n) != n) + if (write_in_full(proc.in, buf, n) < 0) break; } close(proc.in); @@ -919,9 +920,9 @@ static int update_shallow_ref(struct command *cmd, struct shallow_info *si) */ static int head_has_history(void) { - unsigned char sha1[20]; + struct object_id oid; - return !get_sha1("HEAD", sha1); + return !get_oid("HEAD", &oid); } static const char *push_to_deploy(unsigned char *sha1, @@ -1138,7 +1139,7 @@ static const char *update(struct command *cmd, struct shallow_info *si) } if (ref_transaction_delete(transaction, namespaced_name, - old_oid->hash, + old_oid ? old_oid->hash : NULL, 0, "push", &err)) { rp_error("%s", err.buf); strbuf_release(&err); @@ -1206,11 +1207,10 @@ static void check_aliased_update(struct command *cmd, struct string_list *list) const char *dst_name; struct string_list_item *item; struct command *dst_cmd; - unsigned char sha1[GIT_MAX_RAWSZ]; int flag; strbuf_addf(&buf, "%s%s", get_git_namespace(), cmd->ref_name); - dst_name = resolve_ref_unsafe(buf.buf, 0, sha1, &flag); + dst_name = resolve_ref_unsafe(buf.buf, 0, NULL, &flag); strbuf_release(&buf); if (!(flag & REF_ISSYMREF)) |