Merge branch 'bk/refs-multi-update'

Give "update-refs" a "--stdin" option to read multiple update
requests and perform them in an all-or-none fashion.

* bk/refs-multi-update:
  update-ref: add test cases covering --stdin signature
  update-ref: support multiple simultaneous updates
  refs: add update_refs for multiple simultaneous updates
  refs: add function to repack without multiple refs
  refs: factor delete_ref loose ref step into a helper
  refs: factor update_ref steps into helpers
  refs: report ref type from lock_any_ref_for_update
  reset: rename update_refs to reset_refs
This commit is contained in:
Junio C Hamano
2013-09-20 12:36:12 -07:00
15 changed files with 1139 additions and 41 deletions

View File

@ -226,7 +226,7 @@ static void parse_args(struct pathspec *pathspec,
prefix, argv);
}
static int update_refs(const char *rev, const unsigned char *sha1)
static int reset_refs(const char *rev, const unsigned char *sha1)
{
int update_ref_status;
struct strbuf msg = STRBUF_INIT;
@ -354,7 +354,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
if (!pathspec.nr && !unborn) {
/* Any resets without paths update HEAD to the head being
* switched to, saving the previous head in ORIG_HEAD before. */
update_ref_status = update_refs(rev, sha1);
update_ref_status = reset_refs(rev, sha1);
if (reset_type == HARD && !update_ref_status && !quiet)
print_new_head_line(lookup_commit_reference(sha1));