]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/stash.c
Merge branch 'rs/refspec-leakfix'
[thirdparty/git.git] / builtin / stash.c
index 10d87630cd0017f177b8c33929e5a94adaee6b0e..3f811f30506ab799f9bb4d1f37599c74175916d0 100644 (file)
@@ -185,7 +185,7 @@ static int get_stash_info(struct stash_info *info, int argc, const char **argv)
        end_of_rev = strchrnul(revision, '@');
        strbuf_add(&symbolic, revision, end_of_rev - revision);
 
-       ret = dwim_ref(symbolic.buf, symbolic.len, &dummy, &expanded_ref);
+       ret = dwim_ref(symbolic.buf, symbolic.len, &dummy, &expanded_ref, 0);
        strbuf_release(&symbolic);
        switch (ret) {
        case 0: /* Not found, but valid ref */
@@ -864,7 +864,7 @@ static int get_untracked_files(const struct pathspec *ps, int include_untracked,
        int found = 0;
        struct dir_struct dir;
 
-       memset(&dir, 0, sizeof(dir));
+       dir_init(&dir);
        if (include_untracked != INCLUDE_ALL_FILES)
                setup_standard_excludes(&dir);
 
@@ -875,12 +875,9 @@ static int get_untracked_files(const struct pathspec *ps, int include_untracked,
                strbuf_addstr(untracked_files, ent->name);
                /* NUL-terminate: will be fed to update-index -z */
                strbuf_addch(untracked_files, '\0');
-               free(ent);
        }
 
-       free(dir.entries);
-       free(dir.ignored);
-       clear_directory(&dir);
+       dir_clear(&dir);
        return found;
 }