]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'mh/reflife'
authorJunio C Hamano <gitster@pobox.com>
Fri, 14 Jun 2013 15:46:13 +0000 (08:46 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 14 Jun 2013 15:46:14 +0000 (08:46 -0700)
Define memory ownership and lifetime rules for what for-each-ref
feeds to its callbacks (in short, "you do not own it, so make a
copy if you want to keep it").

* mh/reflife: (25 commits)
  refs: document the lifetime of the args passed to each_ref_fn
  register_ref(): make a copy of the bad reference SHA-1
  exclude_existing(): set existing_refs.strdup_strings
  string_list_add_refs_by_glob(): add a comment about memory management
  string_list_add_one_ref(): rename first parameter to "refname"
  show_head_ref(): rename first parameter to "refname"
  show_head_ref(): do not shadow name of argument
  add_existing(): do not retain a reference to sha1
  do_fetch(): clean up existing_refs before exiting
  do_fetch(): reduce scope of peer_item
  object_array_entry: fix memory handling of the name field
  find_first_merges(): remove unnecessary code
  find_first_merges(): initialize merges variable using initializer
  fsck: don't put a void*-shaped peg in a char*-shaped hole
  object_array_remove_duplicates(): rewrite to reduce copying
  revision: use object_array_filter() in implementation of gc_boundary()
  object_array: add function object_array_filter()
  revision: split some overly-long lines
  cmd_diff(): make it obvious which cases are exclusive of each other
  cmd_diff(): rename local variable "list" -> "entry"
  ...

1  2 
builtin/describe.c
builtin/fetch.c
object.c
refs.h
revision.c
revision.h
submodule.c

Simple merge
diff --cc builtin/fetch.c
Simple merge
diff --cc object.c
Simple merge
diff --cc refs.h
Simple merge
diff --cc revision.c
Simple merge
diff --cc revision.h
index 24547b59f1d8f0d77bee6174600ea1bcb2e1b2a9,96284651dba13f5c8a737a582cf37004f71c8f3a..eeea6fba3c5408d5567eec238d0a331bf64ddc04
@@@ -245,17 -246,9 +253,19 @@@ enum commit_action 
        commit_error
  };
  
- extern enum commit_action get_commit_action(struct rev_info *revs, struct commit *commit);
- extern enum commit_action simplify_commit(struct rev_info *revs, struct commit *commit);
+ extern enum commit_action get_commit_action(struct rev_info *revs,
+                                           struct commit *commit);
+ extern enum commit_action simplify_commit(struct rev_info *revs,
+                                         struct commit *commit);
  
 +enum rewrite_result {
 +      rewrite_one_ok,
 +      rewrite_one_noparents,
 +      rewrite_one_error
 +};
 +
 +typedef enum rewrite_result (*rewrite_parent_fn_t)(struct rev_info *revs, struct commit **pp);
 +
 +extern int rewrite_parents(struct rev_info *revs, struct commit *commit,
 +      rewrite_parent_fn_t rewrite_parent);
  #endif
diff --cc submodule.c
Simple merge