]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jt/interpret-branch-name-fallback'
authorJunio C Hamano <gitster@pobox.com>
Wed, 9 Sep 2020 20:53:08 +0000 (13:53 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 9 Sep 2020 20:53:09 +0000 (13:53 -0700)
"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

14 files changed:
1  2 
builtin/checkout.c
builtin/log.c
builtin/merge.c
builtin/show-branch.c
builtin/stash.c
bundle.c
cache.h
commit.c
refs.c
refs.h
remote.c
revision.c
t/t7508-status.sh
wt-status.c

Simple merge
diff --cc builtin/log.c
Simple merge
diff --cc builtin/merge.c
Simple merge
Simple merge
diff --cc builtin/stash.c
Simple merge
diff --cc bundle.c
Simple merge
diff --cc cache.h
Simple merge
diff --cc commit.c
Simple merge
diff --cc refs.c
Simple merge
diff --cc refs.h
index 04bd25019f344b72a3e05470f675dab9b4ffc19d,411a68a0e54e2f5f08bbf1c39f365bdac167ce80..66955181569b3d71363d8da752245f2a1efb7b1f
--- 1/refs.h
--- 2/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);
  
  /*
diff --cc remote.c
Simple merge
diff --cc revision.c
Simple merge
Simple merge
diff --cc wt-status.c
Simple merge