t5520: test work tree fast-forward when fetch updates head
[gitweb.git] / dir.c
diff --git a/dir.c b/dir.c
index bd274a73f1faaee40bce34024ef17bfd44fbcad7..3f7a0256b61552c6c3f80f710bd042b697d79da9 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -826,9 +826,9 @@ static void prep_exclude(struct dir_struct *dir, const char *base, int baselen)
        current = stk ? stk->baselen : -1;
        strbuf_setlen(&dir->basebuf, current < 0 ? 0 : current);
        while (current < baselen) {
-               struct exclude_stack *stk = xcalloc(1, sizeof(*stk));
                const char *cp;
 
+               stk = xcalloc(1, sizeof(*stk));
                if (current < 0) {
                        cp = base;
                        current = 0;