X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=unpack-file.c;h=ac9cbf7cd8ed1367151de0e8b96668f498b7f1a1;hb=39c448c19de7269e6130b6e183645c5b9afe0579;hp=bcdc8bbb3b44a43aa43db6035a31478158e070af;hpb=b71ce7f3f13ebd0e212bdda82b012ee36df4f63f;p=git.git diff --git a/unpack-file.c b/unpack-file.c index bcdc8bbb3..ac9cbf7cd 100644 --- a/unpack-file.c +++ b/unpack-file.c @@ -1,5 +1,6 @@ #include "cache.h" #include "blob.h" +#include "exec_cmd.h" static char *create_temp_file(unsigned char *sha1) { @@ -16,7 +17,7 @@ static char *create_temp_file(unsigned char *sha1) strcpy(path, ".merge_file_XXXXXX"); fd = xmkstemp(path); if (write_in_full(fd, buf, size) != size) - die("unable to write temp-file"); + die_errno("unable to write temp-file"); close(fd); return path; } @@ -25,8 +26,10 @@ int main(int argc, char **argv) { unsigned char sha1[20]; + git_extract_argv0_path(argv[0]); + if (argc != 2) - usage("git-unpack-file "); + usage("git unpack-file "); if (get_sha1(argv[1], sha1)) die("Not a valid object name %s", argv[1]);