summaryrefslogtreecommitdiff
path: root/refs.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-09-09 13:53:08 -0700
committerJunio C Hamano <gitster@pobox.com>2020-09-09 13:53:09 -0700
commit0df670bc0b8b5499859829ba0889ce96a75304a6 (patch)
treee95738e380852775d16806643a57ece2d4d39461 /refs.h
parent7364aee138326303371c1a17d3259912366c1b55 (diff)
parentf24c30e0b6b13078d8fc7cd71b9989d28fd76610 (diff)
downloadgit-0df670bc0b8b5499859829ba0889ce96a75304a6.tar.gz
Merge branch 'jt/interpret-branch-name-fallback'
"git status" has trouble showing where it came from by interpreting reflog entries that recordcertain events, e.g. "checkout @{u}", and gives a hard/fatal error. Even though it inherently is impossible to give a correct answer because the reflog entries lose some information (e.g. "@{u}" does not record what branch the user was on hence which branch 'the upstream' needs to be computed, and even if the record were available, the relationship between branches may have changed), at least hide the error to allow "status" show its output. * jt/interpret-branch-name-fallback: wt-status: tolerate dangling marks refs: move dwim_ref() to header file sha1-name: replace unsigned int with option struct
Diffstat (limited to 'refs.h')
-rw-r--r--refs.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/refs.h b/refs.h
index 04bd25019f..6695518156 100644
--- a/refs.h
+++ b/refs.h
@@ -1,6 +1,8 @@
#ifndef REFS_H
#define REFS_H
+#include "cache.h"
+
struct object_id;
struct ref_store;
struct repository;
@@ -151,9 +153,15 @@ struct strvec;
void expand_ref_prefix(struct strvec *prefixes, const char *prefix);
int expand_ref(struct repository *r, const char *str, int len, struct object_id *oid, char **ref);
-int repo_dwim_ref(struct repository *r, const char *str, int len, struct object_id *oid, char **ref);
+int repo_dwim_ref(struct repository *r, const char *str, int len,
+ struct object_id *oid, char **ref, int nonfatal_dangling_mark);
int repo_dwim_log(struct repository *r, const char *str, int len, struct object_id *oid, char **ref);
-int dwim_ref(const char *str, int len, struct object_id *oid, char **ref);
+static inline int dwim_ref(const char *str, int len, struct object_id *oid,
+ char **ref, int nonfatal_dangling_mark)
+{
+ return repo_dwim_ref(the_repository, str, len, oid, ref,
+ nonfatal_dangling_mark);
+}
int dwim_log(const char *str, int len, struct object_id *oid, char **ref);
/*