Code

pretty-options.txt: tiny doc fix
[git.git] / builtin-fetch--tool.c
index 2065466f272dba506e6c34f16b12e4726996e0ec..e2f8ede9ae4507ed1e431f9d14fc649f6475627d 100644 (file)
@@ -1,3 +1,4 @@
+#include "builtin.h"
 #include "cache.h"
 #include "refs.h"
 #include "commit.h"
@@ -6,11 +7,11 @@
 
 static char *get_stdin(void)
 {
-       int offset = 0;
+       size_t offset = 0;
        char *data = xmalloc(CHUNK_SIZE);
 
        while (1) {
-               int cnt = xread(0, data + offset, CHUNK_SIZE);
+               ssize_t cnt = xread(0, data + offset, CHUNK_SIZE);
                if (cnt < 0)
                        die("error reading standard input: %s",
                            strerror(errno));
@@ -42,7 +43,7 @@ static int update_ref(const char *action,
        if (!rla)
                rla = "(reflog update)";
        snprintf(msg, sizeof(msg), "%s: %s", rla, action);
-       lock = lock_any_ref_for_update(refname, oldval);
+       lock = lock_any_ref_for_update(refname, oldval, 0);
        if (!lock)
                return 1;
        if (write_ref_sha1(lock, sha1, msg) < 0)