Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-09-29 23:36:10 +0400
committerJunio C Hamano <gitster@pobox.com>2014-09-29 23:36:10 +0400
commit507fe835ed0753ff266fdb998853cc5dea3758c6 (patch)
tree06a7d355d50bea90bf2a3859c11e9d9a5b633b6f /refs.c
parentb8e533f12acec63242c5405286fbbcfa66eecfdd (diff)
parent1956dfa818e376c5d62adc16d77f5b5cacf923f8 (diff)
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 'refs.c')
-rw-r--r--refs.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/refs.c b/refs.c
index 311a6b52b1..ffd45e9292 100644
--- a/refs.c
+++ b/refs.c
@@ -3159,7 +3159,7 @@ static int read_ref_at_ent_oldest(unsigned char *osha1, unsigned char *nsha1,
return 1;
}
-int read_ref_at(const char *refname, unsigned long at_time, int cnt,
+int read_ref_at(const char *refname, unsigned int flags, unsigned long at_time, int cnt,
unsigned char *sha1, char **msg,
unsigned long *cutoff_time, int *cutoff_tz, int *cutoff_cnt)
{
@@ -3177,8 +3177,12 @@ int read_ref_at(const char *refname, unsigned long at_time, int cnt,
for_each_reflog_ent_reverse(refname, read_ref_at_ent, &cb);
- if (!cb.reccnt)
- die("Log for %s is empty.", refname);
+ if (!cb.reccnt) {
+ if (flags & GET_SHA1_QUIETLY)
+ exit(128);
+ else
+ die("Log for %s is empty.", refname);
+ }
if (cb.found_it)
return 0;