]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/submodule--helper.c
submodule: check for NULL return of get_submodule_ref_store()
authorRené Scharfe <l.s.r@web.de>
Wed, 28 Mar 2018 21:14:08 +0000 (23:14 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Mar 2018 22:27:02 +0000 (15:27 -0700)
commit74b6bda32f8350b2dc32f8d66f4046272168184e
treed28392eae5310dd3009e5806ac78b891c49bf485
parentd32eb83c1db7d0a8bb54fe743c6d1dd674d372c5
submodule: check for NULL return of get_submodule_ref_store()

If we can't find a ref store for a submodule then assume the latter
is not initialized (or was removed).  Print a status line accordingly
instead of causing a segmentation fault by passing NULL as the first
parameter of refs_head_ref().

Reported-by: Jeremy Feusi <jeremy@feusi.co>
Reviewed-by: Stefan Beller <sbeller@google.com>
Initial-Test-By: Stefan Beller <sbeller@google.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/submodule--helper.c
t/t7400-submodule-basic.sh