Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

status: fix crash in git status --deserialize --verbose (based on v2.26) #260

Commits on Apr 13, 2020

  1. wt-status-deserialize: fix crash when -v is used

    Fix crash in `git status -v` by setting `des_s->repo`
    to a non-null value.
    
    Upstream changes to eliminate use of `the_repository`
    added a `repo` field to `struct status`.  And calls in
    `wt-status.c` to `repo_init_revisions()` were changed
    to pass `s->repo` rather than `the_repository`.
    
    The status deserialization code was not updated to
    actually set `s->repo` before common code passed the
    value to OID routines.
    
    This caused a segfault when verbose output was requested.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler committed Apr 13, 2020
    Configuration menu
    Copy the full SHA
    1426017 View commit details
    Browse the repository at this point in the history
  2. status: disable deserialize when verbose output requested.

    Disable deserialization when verbose output requested.
    
    Verbose mode causes Git to print diffs for modified files.
    This requires the index to be loaded to have the currently
    staged OID values.  Without loading the index, verbose output
    make it look like everything was deleted.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler committed Apr 13, 2020
    Configuration menu
    Copy the full SHA
    5999de1 View commit details
    Browse the repository at this point in the history
  3. t7524: add test for verbose status deserialzation

    Verify that `git status --deserialize=x -v` does not crash and
    generates the same output as a normal (scanning) status command.
    
    These issues are described in the previous 2 commits.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler committed Apr 13, 2020
    Configuration menu
    Copy the full SHA
    509f9cd View commit details
    Browse the repository at this point in the history