Merge branch 'jn/maint-sequencer-fixes'
authorJunio C Hamano <gitster@pobox.com>
Tue, 20 Dec 2011 00:05:45 +0000 (16:05 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 20 Dec 2011 00:05:45 +0000 (16:05 -0800)
* jn/maint-sequencer-fixes:
revert: stop creating and removing sequencer-old directory
Revert "reset: Make reset remove the sequencer state"
revert: do not remove state until sequence is finished
revert: allow single-pick in the middle of cherry-pick sequence
revert: pass around rev-list args in already-parsed form
revert: allow cherry-pick --continue to commit before resuming
revert: give --continue handling its own function

1  2 
branch.c
diff --combined branch.c
index a715a1174982970943ed2c4fc1c2ab4906699fdc,a6b6722e24bc196a54be5ab1240e8932e53483e2..c2e625f40c9d77fa048b905ca4a3982da563b299
+++ b/branch.c
@@@ -3,7 -3,6 +3,6 @@@
  #include "refs.h"
  #include "remote.h"
  #include "commit.h"
- #include "sequencer.h"
  
  struct tracking {
        struct refspec spec;
@@@ -136,37 -135,6 +135,37 @@@ static int setup_tracking(const char *n
        return 0;
  }
  
 +struct branch_desc_cb {
 +      const char *config_name;
 +      const char *value;
 +};
 +
 +static int read_branch_desc_cb(const char *var, const char *value, void *cb)
 +{
 +      struct branch_desc_cb *desc = cb;
 +      if (strcmp(desc->config_name, var))
 +              return 0;
 +      free((char *)desc->value);
 +      return git_config_string(&desc->value, var, value);
 +}
 +
 +int read_branch_desc(struct strbuf *buf, const char *branch_name)
 +{
 +      struct branch_desc_cb cb;
 +      struct strbuf name = STRBUF_INIT;
 +      strbuf_addf(&name, "branch.%s.description", branch_name);
 +      cb.config_name = name.buf;
 +      cb.value = NULL;
 +      if (git_config(read_branch_desc_cb, &cb) < 0) {
 +              strbuf_release(&name);
 +              return -1;
 +      }
 +      if (cb.value)
 +              strbuf_addstr(buf, cb.value);
 +      strbuf_release(&name);
 +      return 0;
 +}
 +
  int validate_new_branchname(const char *name, struct strbuf *ref,
                            int force, int attr_only)
  {
  
  void create_branch(const char *head,
                   const char *name, const char *start_name,
 -                 int force, int reflog, enum branch_track track)
 +                 int force, int reflog, int clobber_head,
 +                 enum branch_track track)
  {
        struct ref_lock *lock = NULL;
        struct commit *commit;
                explicit_tracking = 1;
  
        if (validate_new_branchname(name, &ref, force,
 -                                  track == BRANCH_TRACK_OVERRIDE)) {
 +                                  track == BRANCH_TRACK_OVERRIDE ||
 +                                  clobber_head)) {
                if (!force)
                        dont_change_ref = 1;
                else
@@@ -280,5 -246,4 +279,4 @@@ void remove_branch_state(void
        unlink(git_path("MERGE_MSG"));
        unlink(git_path("MERGE_MODE"));
        unlink(git_path("SQUASH_MSG"));
-       remove_sequencer_state(0);
  }