git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/3] repack: improve warnings about failure of renaming and removing files

From
Stefan Beller <stefanbeller@googlemail.com>
Date
Sep 15, 2013, 15:33 UTC
Message-ID
<1379259202-5042-3-git-send-email-stefanbeller@googlemail.com>
In-Reply-To
<1379259202-5042-1-git-send-email-stefanbeller@googlemail.com>
Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
---
 builtin/repack.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/builtin/repack.c b/builtin/repack.c
index d345d16..f7e91bf 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -327,7 +327,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
 				chmod(fname_old, statbuffer.st_mode);
 			}
 			if (rename(fname_old, fname))
-				exit(errno);
+				die_errno(_("renaming '%s' failed"), fname_old);
 			free(fname);
 			free(fname_old);
 		}
@@ -341,7 +341,8 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
 					packdir,
 					item->string,
 					exts[ext]);
-			remove_path(fname);
+			if (remove_path(fname))
+				warning(_("removing '%s' failed"), fname);
 		}
 	}
 
-- 
1.8.4.273.ga194ead
Previous: Stefan BellerNext: Ramkumar Ramachandra
Message 3 of 8 in “repack: rewrite the shell script in C”
  1. 1/3 repack: rewrite the shell script in CStefan Beller, Sep 15, 2013
  2. 2/3 repack: retain the return value of pack-objectsStefan Beller, Sep 15, 2013
  3. 3/3 repack: improve warnings about failure of renaming and removing filesStefan Beller, Sep 15, 2013
  4. Ramkumar RamachandraSep 15, 2013
  5. Junio C HamanoSep 17, 2013
  6. Junio C HamanoSep 17, 2013
  7. Stefan BellerSep 17, 2013
  8. Junio C HamanoSep 17, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.