Merge branch 'mz/reset-misc' into next
commita93b3941400124066e27d47ab5948f680720e34b
authorJunio C Hamano <gitster@pobox.com>
Tue, 15 Jan 2013 20:07:40 +0000 (15 12:07 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 15 Jan 2013 20:07:40 +0000 (15 12:07 -0800)
tree3a6747b49e7b8723bfbe00695a1accf51fbe486b
parent1ee379e3a0d859005543618e6bc6a718bf90beca
parent3fde386a40f38dbaa684c17603e71909b862d021
Merge branch 'mz/reset-misc' into next

Various 'reset' optimizations and clean-ups, followed by a change
to allow "git reset" to work even on an unborn branch.

* mz/reset-misc:
  reset [--mixed]: use diff-based reset whether or not pathspec was given
  reset: allow reset on unborn branch
  reset $sha1 $pathspec: require $sha1 only to be treeish
  reset.c: inline update_index_refresh()
  reset.c: finish entire cmd_reset() whether or not pathspec is given
  reset [--mixed]: only write index file once
  reset.c: move lock, write and commit out of update_index_refresh()
  reset.c: move update_index_refresh() call out of read_from_tree()
  reset.c: replace switch by if-else
  reset: avoid redundant error message
  reset --keep: only write index file once
  reset.c: share call to die_if_unmerged_cache()
  reset.c: extract function for updating {ORIG_,}HEAD
  reset.c: remove unnecessary variable 'i'
  reset.c: extract function for parsing arguments
  reset: don't allow "git reset -- $pathspec" in bare repo
  reset.c: pass pathspec around instead of (prefix, argv) pair
  reset $pathspec: exit with code 0 if successful
  reset $pathspec: no need to discard index