repack: improve warnings about failure of renaming and removing files

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Stefan Beller 2013-09-15 17:33:22 +02:00 committed by Junio C Hamano
parent ffc9329f48
commit 0b63c6a5b7

View File

@ -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);
}
}