]> asedeno.scripts.mit.edu Git - git.git/blobdiff - builtin-fetch--tool.c
connect: display connection progress
[git.git] / builtin-fetch--tool.c
index 3145c01f7e0e81bf28314b92737ccf2abb129dcd..12adb3833cd60771f8e63b2ebaecff3769fa74e2 100644 (file)
@@ -6,11 +6,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));
@@ -35,16 +35,13 @@ static int update_ref(const char *action,
                      unsigned char *sha1,
                      unsigned char *oldval)
 {
-       int len;
        char msg[1024];
        char *rla = getenv("GIT_REFLOG_ACTION");
        static struct ref_lock *lock;
 
        if (!rla)
                rla = "(reflog update)";
-       len = snprintf(msg, sizeof(msg), "%s: %s", rla, action);
-       if (sizeof(msg) <= len)
-               die("insanely long action");
+       snprintf(msg, sizeof(msg), "%s: %s", rla, action);
        lock = lock_any_ref_for_update(refname, oldval);
        if (!lock)
                return 1;