X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=hash-object.c;h=9455dd0709aeb81436ef2e3e36422578d66ce8e7;hb=cfe370c6476392095bc3f18013d195b1cccd6184;hp=adfd5336a31412681415c47d2420aba8ed299ae3;hpb=0d5055665ca1e76659ffa96bf972b4b0125ea069;p=git.git diff --git a/hash-object.c b/hash-object.c index adfd5336a..9455dd070 100644 --- a/hash-object.c +++ b/hash-object.c @@ -8,6 +8,7 @@ #include "blob.h" #include "quote.h" #include "parse-options.h" +#include "exec_cmd.h" static void hash_fd(int fd, const char *type, int write_object, const char *path) { @@ -28,7 +29,7 @@ static void hash_object(const char *path, const char *type, int write_object, int fd; fd = open(path, O_RDONLY); if (fd < 0) - die("Cannot open %s", path); + die_errno("Cannot open '%s'", path); hash_fd(fd, type, write_object, vpath); } @@ -81,7 +82,10 @@ int main(int argc, const char **argv) type = blob_type; - argc = parse_options(argc, argv, hash_object_options, hash_object_usage, 0); + git_extract_argv0_path(argv[0]); + + argc = parse_options(argc, argv, NULL, hash_object_options, + hash_object_usage, 0); if (write_object) { prefix = setup_git_directory();