Merge branch 'jc/am'
authorJunio C Hamano <gitster@pobox.com>
Sun, 9 Mar 2008 04:10:05 +0000 (20:10 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sun, 9 Mar 2008 04:10:05 +0000 (20:10 -0800)
* jc/am:
am: --rebasing
am: remove support for -d .dotest
am: read from the right mailbox when started from a subdirectory

1  2 
contrib/completion/git-completion.bash
index 49e6df09654f061d674f18ffcd6347f82ea644fa,5ae87998e6cc434ee5de8413426429fd891b0ac1..848c067b57398154de6dc5287648b4103841217a
@@@ -70,7 -70,15 +70,15 @@@ __git_ps1 (
                local b
                if [ -d "$g/../.dotest" ]
                then
-                       r="|AM/REBASE"
+                       if test -f "$g/../.dotest/rebasing"
+                       then
+                               r="|REBASE"
+                       elif test -f "$g/../.dotest/applying"
+                       then
+                               r="|AM"
+                       else
+                               r="|AM/REBASE"
+                       fi
                        b="$(git symbolic-ref HEAD 2>/dev/null)"
                elif [ -f "$g/.dotest-merge/interactive" ]
                then
@@@ -506,33 -514,7 +514,33 @@@ _git_bisect (
  
  _git_branch ()
  {
 -      __gitcomp "$(__git_refs)"
 +      local i c=1 only_local_ref="n" has_r="n"
 +
 +      while [ $c -lt $COMP_CWORD ]; do
 +              i="${COMP_WORDS[c]}"
 +              case "$i" in
 +              -d|-m)  only_local_ref="y" ;;
 +              -r)     has_r="y" ;;
 +              esac
 +              c=$((++c))
 +      done
 +
 +      case "${COMP_WORDS[COMP_CWORD]}" in
 +      --*=*)  COMPREPLY=() ;;
 +      --*)
 +              __gitcomp "
 +                      --color --no-color --verbose --abbrev= --no-abbrev
 +                      --track --no-track
 +                      "
 +              ;;
 +      *)
 +              if [ $only_local_ref = "y" -a $has_r = "n" ]; then
 +                      __gitcomp "$(__git_heads)"
 +              else
 +                      __gitcomp "$(__git_refs)"
 +              fi
 +              ;;
 +      esac
  }
  
  _git_bundle ()