]> git.ipfire.org Git - thirdparty/git.git/blobdiff - shallow.c
Merge branch 'vd/fsck-submodule-url-test'
[thirdparty/git.git] / shallow.c
index 5413719fd4ef16c130117440c4d4687f9c1c5525..7711798127e49efaa18b6403ecf103f05e92f7e7 100644 (file)
--- a/shallow.c
+++ b/shallow.c
@@ -7,7 +7,6 @@
 #include "commit.h"
 #include "tag.h"
 #include "pkt-line.h"
-#include "remote.h"
 #include "refs.h"
 #include "oid-array.h"
 #include "path.h"
@@ -38,8 +37,10 @@ int register_shallow(struct repository *r, const struct object_id *oid)
 
        oidcpy(&graft->oid, oid);
        graft->nr_parent = -1;
-       if (commit && commit->object.parsed)
+       if (commit && commit->object.parsed) {
+               free_commit_list(commit->parents);
                commit->parents = NULL;
+       }
        return register_commit_graft(r, graft, 0);
 }