[PATCH] submodule: check for NULL return of get_submodule_ref_store()

2018-03-28 Thread Stefan Beller
From: René Scharfe If we can't find a ref store for a submodule then assume it 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 Signed-off

Re: [PATCH] submodule: check for NULL return of get_submodule_ref_store()

2018-03-28 Thread Eric Sunshine
On Wed, Mar 28, 2018 at 2:38 PM, Stefan Beller wrote: > diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh > @@ -821,6 +821,18 @@ test_expect_success 'moving the superproject does not > break submodules' ' > +test_expect_success 'moving the submodule does not break the superproj

Re: [PATCH] submodule: check for NULL return of get_submodule_ref_store()

2018-03-28 Thread Stefan Beller
On Wed, Mar 28, 2018 at 11:57 AM, Eric Sunshine wrote: > On Wed, Mar 28, 2018 at 2:38 PM, Stefan Beller wrote: >> diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh >> @@ -821,6 +821,18 @@ test_expect_success 'moving the superproject does not >> break submodules' ' >> +test_exp

Re: [PATCH] submodule: check for NULL return of get_submodule_ref_store()

2018-03-28 Thread Eric Sunshine
On Wed, Mar 28, 2018 at 4:08 PM, Stefan Beller wrote: > On Wed, Mar 28, 2018 at 11:57 AM, Eric Sunshine > wrote: >>> +test_expect_success 'moving the submodule does not break the superproject' >>> ' >>> + ( >>> + cd addtest2 && >>> + >>> + mv repo repo.bak && >

Re: [PATCH] submodule: check for NULL return of get_submodule_ref_store()

2018-03-28 Thread Stefan Beller
On Wed, Mar 28, 2018 at 1:21 PM, Eric Sunshine wrote: > Or, even simpler: > > mv addtest2/repo addtest2/repo.bak && > test_when_finished "mv addtest2/repo.bak addtest2/repo" && > git -C addtest2 submodule status >actual && > grep -e "^-" -e repo actual I like this! Time permittin

Re: [PATCH] submodule: check for NULL return of get_submodule_ref_store()

2018-03-28 Thread René Scharfe
Am 28.03.2018 um 22:21 schrieb Eric Sunshine: > On Wed, Mar 28, 2018 at 4:08 PM, Stefan Beller wrote: >> On Wed, Mar 28, 2018 at 11:57 AM, Eric Sunshine >> wrote: +test_expect_success 'moving the submodule does not break the superproject' ' + ( + cd addte

Re: [PATCH] submodule: check for NULL return of get_submodule_ref_store()

2018-03-28 Thread Stefan Beller
> This looks nicer here in the script, but doesn't test exactly what users > type most of the time, I suppose. > > So how about this? Looks good to me, though I had a nagging feeling at first that the regex could be made more concise. Why do we need the optional "[^ ]" inside \1 ? > + sed -

Re: [PATCH] submodule: check for NULL return of get_submodule_ref_store()

2018-03-28 Thread René Scharfe
Am 28.03.2018 um 23:37 schrieb Stefan Beller: >> This looks nicer here in the script, but doesn't test exactly what users >> type most of the time, I suppose. >> >> So how about this? > > Looks good to me, though I had a nagging feeling at first that the > regex could be made more concise. > Why d

Re: [PATCH] submodule: check for NULL return of get_submodule_ref_store()

2018-03-28 Thread Junio C Hamano
Stefan Beller writes: >> This looks nicer here in the script, but doesn't test exactly what users >> type most of the time, I suppose. >> >> So how about this? > > Looks good to me, though I had a nagging feeling at first that the > regex could be made more concise. > Why do we need the optional