Download raw body.
bug/fix: segfault when diffing the root commit
Alexander Arkhipov <aa@manpager.net> wrote: > Hello, gameoftrees@, > > I noticed a bug in got, where typing `got -c <root commit> file' causes > a segfault. The issue is caused by the NULL pointer tree being accessed > in find_entry_by_name() in lib/object.c. I fixed the problem the obvious > way by immediately returning NULL if tree is NULL. Now, however, it > instead outputs error messages like this: > > got: file: no such entry found in tree Sorry, just realised my mistake here: the message only was like that because the file I was testing with was not in the first commit, although I assumed it was. Testing with the patch and a file that *was* added with the first commit actually produces the correct result -- a diff for that file! Without the patch, however, the command always segfaults, regardless of the file's existence at the time of the commit. Alexander
bug/fix: segfault when diffing the root commit