Document git-merge-cache -o
[git.git] / checkout-cache.c
index 367b9c7..64ce921 100644 (file)
@@ -48,6 +48,7 @@ static void create_directories(const char *path)
                buf[len] = 0;
                mkdir(buf, 0755);
        }
+       free(buf);
 }
 
 static int create_file(const char *path, unsigned int mode)
@@ -96,6 +97,7 @@ static int write_entry(struct cache_entry *ce, const char *path)
        case S_IFLNK:
                memcpy(target, new, size);
                target[size] = '\0';
+               create_directories(path);
                if (symlink(target, path)) {
                        free(new);
                        return error("checkout-cache: unable to create symlink %s (%s)",