[PATCH v2] builtin/rm.c: use die_errno() when system call fails
- From
- Gatla Vishweshwar Reddy <gatlavishweshwarreddy26@gmail.com>
- Date
- Jul 6, 2026, 19:10 UTC
- Message-ID
- <20260706191024.93788-1-gatlavishweshwarreddy26@gmail.com>
When remove_file_from_index() fails, the errno value contains the reason for the failure. Using die() instead of die_errno() loses this information, making it harder to diagnose failures. Switch to die_errno() to include the system error message in the output.
Signed-off-by: Gatla Vishweshwar Reddy <gatlavishweshwarreddy26@gmail.com> --- builtin/rm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/rm.c b/builtin/rm.c index 081d0bc375..3f5e6e232d 100644 --- a/builtin/rm.c +++ b/builtin/rm.c @@ -396,7 +396,7 @@ int cmd_rm(int argc, printf("rm '%s'\n", path); if (remove_file_from_index(the_repository->index, path)) - die(_("git rm: unable to remove %s"), path); + die_errno(_("git rm: unable to remove %s"), path); } if (show_only)
-- 2.54.0