From: Junio C Hamano Date: Wed, 9 Sep 2020 20:53:08 +0000 (-0700) Subject: Merge branch 'jt/interpret-branch-name-fallback' X-Git-Tag: v2.29.0-rc0~82 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0df670bc0b8b5499859829ba0889ce96a75304a6;p=thirdparty%2Fgit.git 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 --- 0df670bc0b8b5499859829ba0889ce96a75304a6 diff --cc refs.h index 04bd25019f,411a68a0e5..6695518156 --- a/refs.h +++ b/refs.h @@@ -147,13 -147,19 +149,19 @@@ int refname_match(const char *abbrev_na * Given a 'prefix' expand it by the rules in 'ref_rev_parse_rules' and add * the results to 'prefixes' */ -struct argv_array; -void expand_ref_prefix(struct argv_array *prefixes, const char *prefix); +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); /*