summaryrefslogtreecommitdiff
path: root/builtin/rev-parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/rev-parse.c')
-rw-r--r--builtin/rev-parse.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index 8401b4d7ab..490da33bec 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -3,7 +3,10 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
+
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "builtin.h"
#include "abspath.h"
@@ -710,6 +713,8 @@ int cmd_rev_parse(int argc,
int seen_end_of_options = 0;
enum format_type format = FORMAT_DEFAULT;
+ show_usage_if_asked(argc, argv, builtin_rev_parse_usage);
+
if (argc > 1 && !strcmp("--parseopt", argv[1]))
return cmd_parseopt(argc - 1, argv + 1, prefix);
@@ -784,8 +789,8 @@ int cmd_rev_parse(int argc,
if (!strcmp(arg, "--git-path")) {
if (!argv[i + 1])
die(_("--git-path requires an argument"));
- strbuf_reset(&buf);
- print_path(git_path("%s", argv[i + 1]), prefix,
+ print_path(repo_git_path_replace(the_repository, &buf,
+ "%s", argv[i + 1]), prefix,
format,
DEFAULT_RELATIVE_IF_SHARED);
i++;
@@ -1078,7 +1083,7 @@ int cmd_rev_parse(int argc,
die(_("Could not read the index"));
if (the_repository->index->split_index) {
const struct object_id *oid = &the_repository->index->split_index->base_oid;
- const char *path = git_path("sharedindex.%s", oid_to_hex(oid));
+ const char *path = repo_git_path_replace(the_repository, &buf, "sharedindex.%s", oid_to_hex(oid));
print_path(path, prefix, format, DEFAULT_RELATIVE);
}
continue;