aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/unpack-file.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/unpack-file.c')
-rw-r--r--builtin/unpack-file.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/builtin/unpack-file.c b/builtin/unpack-file.c
index c129e2bb6c..fb5fcbc40a 100644
--- a/builtin/unpack-file.c
+++ b/builtin/unpack-file.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "hex.h"
@@ -25,12 +26,19 @@ static char *create_temp_file(struct object_id *oid)
return path;
}
-int cmd_unpack_file(int argc, const char **argv, const char *prefix UNUSED)
+static const char usage_msg[] =
+"git unpack-file <blob>";
+
+int cmd_unpack_file(int argc,
+ const char **argv,
+ const char *prefix UNUSED,
+ struct repository *repo UNUSED)
{
struct object_id oid;
- if (argc != 2 || !strcmp(argv[1], "-h"))
- usage("git unpack-file <blob>");
+ show_usage_if_asked(argc, argv, usage_msg);
+ if (argc != 2)
+ usage(usage_msg);
if (repo_get_oid(the_repository, argv[1], &oid))
die("Not a valid object name %s", argv[1]);