summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorDerrick Stolee <derrickstolee@github.com>2022-04-26 20:43:20 +0000
committerJunio C Hamano <gitster@pobox.com>2022-04-26 13:56:39 -0700
commit124b05b23005437fa5fb91863bde2a8f5840e164 (patch)
tree0cd13eaa15f19fe4d15297d9b26516edda3e4ed3 /builtin/commit.c
parent4925adb4dac1f794cc5d5c82dee49e2f5f47560f (diff)
rev-parse: integrate with sparse index
It is not obvious that the 'git rev-parse' builtin would use the sparse index, but it is possible to parse paths out of the index using the ":<path>" syntax. The 'git rev-parse' output is only the OID of the object found at that location, but otherwise behaves similarly to 'git show :<path>'. This includes the failure conditions on directories and the error messages depending on whether a path is in the worktree or not. The only code change required is to change the command_requires_full_index setting in builtin/rev-parse.c, and we can re-use many existing 'git show' tests for the rev-parse case. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions