Merge branch 'js/shallow-and-fetch-prune' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 21 Nov 2018 13:57:51 +0000 (22:57 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 21 Nov 2018 13:57:51 +0000 (22:57 +0900)
"git repack" in a shallow clone did not correctly update the
shallow points in the repository, leading to a repository that
does not pass fsck.

* js/shallow-and-fetch-prune:
repack -ad: prune the list of shallow commits
shallow: offer to prune only non-existing entries
repack: point out a bug handling stale shallow info

1  2 
commit.h
diff --combined commit.h
index 12b8b2d6543c758a6e96c0ba2ee287ef0d048e77,861a1593142e9c1816fc47c464143864c7bfbbab..dc5107259fd090cb33d9b25d4bf8530108d7109e
+++ b/commit.h
@@@ -202,7 -202,6 +202,7 @@@ typedef int (*each_commit_graft_fn)(con
  
  struct commit_graft *read_graft_line(struct strbuf *line);
  int register_commit_graft(struct repository *r, struct commit_graft *, int);
 +void prepare_commit_graft(struct repository *r);
  struct commit_graft *lookup_commit_graft(struct repository *r, const struct object_id *oid);
  
  extern struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2);
@@@ -256,7 -255,9 +256,9 @@@ extern void assign_shallow_commits_to_r
                                           uint32_t **used,
                                           int *ref_status);
  extern int delayed_reachability_test(struct shallow_info *si, int c);
- extern void prune_shallow(int show_only);
+ #define PRUNE_SHOW_ONLY 1
+ #define PRUNE_QUICK 2
+ extern void prune_shallow(unsigned options);
  extern struct trace_key trace_shallow;
  
  int is_descendant_of(struct commit *, struct commit_list *);
@@@ -323,7 -324,7 +325,7 @@@ extern const char *find_commit_header(c
                                      size_t *out_len);
  
  /* Find the end of the log message, the right place for a new trailer. */
 -extern int ignore_non_trailer(const char *buf, size_t len);
 +extern size_t ignore_non_trailer(const char *buf, size_t len);
  
  typedef int (*each_mergetag_fn)(struct commit *commit, struct commit_extra_header *extra,
                                 void *cb_data);