Re: [PATCH] pull: do not segfault when HEAD refers to missing object file

2017-03-05 Thread Jeff King
On Mon, Mar 06, 2017 at 07:52:10AM +0100, Johannes Sixt wrote: > > Yeah, it is. You can do it easily with 'sed', of course, but if you want > > to avoid the extra process and do it in pure shell, it's more like: > > > > last38=${REV#??} > > first2=${REV%$last38} > > rm -f .git/objects/$firs

Re: [PATCH] pull: do not segfault when HEAD refers to missing object file

2017-03-05 Thread Jeff King
On Mon, Mar 06, 2017 at 12:42:22AM +0100, André Laszlo wrote: > git pull --rebase on a corrupted HEAD used to segfault;it has been > corrected to error out with a message. A test has also been added to > verify this fix. Your commit message mostly tells us the "what" that we can see from the diff

Re: [PATCH] pull: do not segfault when HEAD refers to missing object file

2017-03-05 Thread Johannes Sixt
Am 06.03.2017 um 04:51 schrieb Jeff King: On Sun, Mar 05, 2017 at 11:52:22PM +, brian m. carlson wrote: On Mon, Mar 06, 2017 at 12:42:22AM +0100, André Laszlo wrote: +test_expect_success 'git pull --rebase with corrupt HEAD does not segfault' ' + mkdir corrupted && + (cd corrup

Re: [PATCH] pull: do not segfault when HEAD refers to missing object file

2017-03-05 Thread Jeff King
On Sun, Mar 05, 2017 at 11:52:22PM +, brian m. carlson wrote: > On Mon, Mar 06, 2017 at 12:42:22AM +0100, André Laszlo wrote: > > +test_expect_success 'git pull --rebase with corrupt HEAD does not > > segfault' ' > > + mkdir corrupted && > > + (cd corrupted && > > + git init && > > +

Re: [PATCH] pull: do not segfault when HEAD refers to missing object file

2017-03-05 Thread brian m. carlson
On Mon, Mar 06, 2017 at 12:42:22AM +0100, André Laszlo wrote: > +test_expect_success 'git pull --rebase with corrupt HEAD does not segfault' ' > + mkdir corrupted && > + (cd corrupted && > + git init && > + echo one >file && git add file && > + git commit -m one && > + REV=$

[PATCH] pull: do not segfault when HEAD refers to missing object file

2017-03-05 Thread André Laszlo
git pull --rebase on a corrupted HEAD used to segfault; it has been corrected to error out with a message. A test has also been added to verify this fix. Signed-off-by: André Laszlo --- Notes: When add_head_to_pending fails to add a pending object, git pull --rebase segfaults. This can h