Fix some tab/space inconsistencies in git-mergetool.sh
[gitweb.git] / walker.c
index 31de6c16bd021003bdd4fc1475bfe500f28773f4..679adab6a0fccef460acaf90b116b8c6cb9bd460 100644 (file)
--- a/walker.c
+++ b/walker.c
@@ -59,6 +59,7 @@ static int process_tree(struct walker *walker, struct tree *tree)
        free(tree->buffer);
        tree->buffer = NULL;
        tree->size = 0;
+       tree->object.parsed = 0;
        return 0;
 }
 
@@ -190,7 +191,7 @@ static int interpret_target(struct walker *walker, char *target, unsigned char *
        if (!get_sha1_hex(target, sha1))
                return 0;
        if (!check_ref_format(target)) {
-               struct ref *ref = alloc_ref_from_str(target);
+               struct ref *ref = alloc_ref(target);
                if (!walker->fetch_ref(walker, ref)) {
                        hashcpy(sha1, ref->old_sha1);
                        free(ref);
@@ -214,9 +215,8 @@ static int mark_complete(const char *path, const unsigned char *sha1, int flag,
 int walker_targets_stdin(char ***target, const char ***write_ref)
 {
        int targets = 0, targets_alloc = 0;
-       struct strbuf buf;
+       struct strbuf buf = STRBUF_INIT;
        *target = NULL; *write_ref = NULL;
-       strbuf_init(&buf, 0);
        while (1) {
                char *rf_one = NULL;
                char *tg_one;