aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/rev-parse.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-09-29 12:36:10 -0700
committerJunio C Hamano <gitster@pobox.com>2014-09-29 12:36:10 -0700
commit507fe835ed0753ff266fdb998853cc5dea3758c6 (patch)
tree06a7d355d50bea90bf2a3859c11e9d9a5b633b6f /builtin/rev-parse.c
parentb8e533f12acec63242c5405286fbbcfa66eecfdd (diff)
parent1956dfa818e376c5d62adc16d77f5b5cacf923f8 (diff)
downloadgit-507fe835ed0753ff266fdb998853cc5dea3758c6.tar.gz
Merge branch 'da/rev-parse-verify-quiet'
"rev-parse --verify --quiet $name" is meant to quietly exit with a non-zero status when $name is not a valid object name, but still gave error messages in some cases. * da/rev-parse-verify-quiet: stash: prefer --quiet over shell redirection of the standard error stream refs: make rev-parse --quiet actually quiet t1503: use test_must_be_empty Documentation: a note about stdout for git rev-parse --verify --quiet
Diffstat (limited to 'builtin/rev-parse.c')
-rw-r--r--builtin/rev-parse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index c911b456de..35d3c43ed6 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -508,7 +508,9 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
int has_dashdash = 0;
int output_prefix = 0;
unsigned char sha1[20];
+ unsigned int flags = 0;
const char *name = NULL;
+ struct object_context unused;
if (argc > 1 && !strcmp("--parseopt", argv[1]))
return cmd_parseopt(argc - 1, argv + 1, prefix);
@@ -596,6 +598,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
}
if (!strcmp(arg, "--quiet") || !strcmp(arg, "-q")) {
quiet = 1;
+ flags |= GET_SHA1_QUIETLY;
continue;
}
if (!strcmp(arg, "--short") ||
@@ -818,7 +821,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
name++;
type = REVERSED;
}
- if (!get_sha1(name, sha1)) {
+ if (!get_sha1_with_context(name, flags, sha1, &unused)) {
if (verify)
revs_count++;
else