]> git.ipfire.org Git - thirdparty/git.git/blobdiff - walker.c
is_ntfs_dotgit: use a size_t for traversing string
[thirdparty/git.git] / walker.c
index 7b7e72b1201850f0ba494f8fc23a5c7f0e46d3eb..2c86e406f92d9bf0063e6be4f9d76fdbbac17c89 100644 (file)
--- a/walker.c
+++ b/walker.c
@@ -9,10 +9,14 @@
 
 static unsigned char current_commit_sha1[20];
 
-void walker_say(struct walker *walker, const char *fmt, const char *hex)
+void walker_say(struct walker *walker, const char *fmt, ...)
 {
-       if (walker->get_verbosely)
-               fprintf(stderr, fmt, hex);
+       if (walker->get_verbosely) {
+               va_list ap;
+               va_start(ap, fmt);
+               vfprintf(stderr, fmt, ap);
+               va_end(ap);
+       }
 }
 
 static void report_missing(const struct object *obj)
@@ -43,12 +47,12 @@ static int process_tree(struct walker *walker, struct tree *tree)
                if (S_ISGITLINK(entry.mode))
                        continue;
                if (S_ISDIR(entry.mode)) {
-                       struct tree *tree = lookup_tree(entry.sha1);
+                       struct tree *tree = lookup_tree(entry.oid->hash);
                        if (tree)
                                obj = &tree->object;
                }
                else {
-                       struct blob *blob = lookup_blob(entry.sha1);
+                       struct blob *blob = lookup_blob(entry.oid->hash);
                        if (blob)
                                obj = &blob->object;
                }
@@ -220,7 +224,7 @@ int walker_targets_stdin(char ***target, const char ***write_ref)
                char *rf_one = NULL;
                char *tg_one;
 
-               if (strbuf_getline(&buf, stdin, '\n') == EOF)
+               if (strbuf_getline_lf(&buf, stdin) == EOF)
                        break;
                tg_one = buf.buf;
                rf_one = strchr(tg_one, '\t');