{"thread":{"id":"21063","subject":"[PATCH] git branch -D: give a better error message when lockfile creation fails","startedAt":"2009-09-25T23:53:06Z","lastAt":"2009-09-25T23:53:06Z","messageCount":1,"participants":["Miklos Vajna"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"123835","messageId":"1253922786-23600-1-git-send-email-vmiklos@frugalware.org","threadId":"21063","inReplyTo":null,"subject":"[PATCH] git branch -D: give a better error message when lockfile creation fails","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-09-25T23:53:06Z","receivedAt":"2009-09-25T23:53:06Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Previously the old error message just told the user that it was not\npossible to delete the ref from the packed-refs file. Give instructions\non how to resolve the problem.\n\nSigned-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n refs.c |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/refs.c b/refs.c\nindex 24865cf..221d49c 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -972,8 +972,10 @@ static int repack_without_ref(const char *refname)\n \tif (!found)\n \t\treturn 0;\n \tfd = hold_lock_file_for_update(&packlock, git_path(\"packed-refs\"), 0);\n-\tif (fd < 0)\n+\tif (fd < 0) {\n+\t\tunable_to_lock_index_die(git_path(\"packed-refs\"), errno);\n \t\treturn error(\"cannot delete '%s' from packed refs\", refname);\n+\t}\n \n \tfor (list = packed_ref_list; list; list = list->next) {\n \t\tchar line[PATH_MAX + 100];\n-- \n1.6.5.rc1.44.ga1675.dirty\n"}]}