X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-pack-refs.c;h=09df4e11a8bb89cded9be4af06bb162b7a92bd4c;hb=e598c5177e439271e8bd81ef2a689a3ab0db80e6;hp=1952950c9a4bf13dc728bb8d6a79493dad36df06;hpb=52912cce77a929aecaa4e982757d813b8d36ba1e;p=git.git diff --git a/builtin-pack-refs.c b/builtin-pack-refs.c index 1952950c9..09df4e11a 100644 --- a/builtin-pack-refs.c +++ b/builtin-pack-refs.c @@ -1,3 +1,4 @@ +#include "builtin.h" #include "cache.h" #include "refs.h" #include "object.h" @@ -105,6 +106,8 @@ static int pack_refs(unsigned int flags) fprintf(cbdata.refs_file, "# pack-refs with: peeled \n"); for_each_ref(handle_one_ref, &cbdata); + if (ferror(cbdata.refs_file)) + die("failed to write ref-pack file"); if (fflush(cbdata.refs_file) || fsync(fd) || fclose(cbdata.refs_file)) die("failed to write ref-pack file (%s)", strerror(errno)); if (commit_lock_file(&packed) < 0)