summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-04-11 04:09:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-11 04:09:56 (GMT)
commit103251a318ed960c9574e68ad21d013fca78560b (patch)
treecb664e4a5ff26e4de16646ef1975ce11daca1dfe /builtin
parent27f25845cf5ebcfd214c16b9d9b53200980dfef8 (diff)
parent74b6bda32f8350b2dc32f8d66f4046272168184e (diff)
downloadgit-103251a318ed960c9574e68ad21d013fca78560b.zip
git-103251a318ed960c9574e68ad21d013fca78560b.tar.gz
git-103251a318ed960c9574e68ad21d013fca78560b.tar.bz2
Merge branch 'rs/status-with-removed-submodule'
"git submodule status" misbehaved on a submodule that has been removed from the working tree. * rs/status-with-removed-submodule: submodule: check for NULL return of get_submodule_ref_store()
Diffstat (limited to 'builtin')
-rw-r--r--builtin/submodule--helper.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index a2327c9..a404df3 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -655,9 +655,13 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,
displaypath);
} else if (!(flags & OPT_CACHED)) {
struct object_id oid;
+ struct ref_store *refs = get_submodule_ref_store(path);
- if (refs_head_ref(get_submodule_ref_store(path),
- handle_submodule_head_ref, &oid))
+ if (!refs) {
+ print_status(flags, '-', path, ce_oid, displaypath);
+ goto cleanup;
+ }
+ if (refs_head_ref(refs, handle_submodule_head_ref, &oid))
die(_("could not resolve HEAD ref inside the "
"submodule '%s'"), path);