Merge branch 'master' into push-new-branch

This commit is contained in:
Nathan Weizenbaum 2010-06-24 17:26:59 -07:00
commit 06c2902449

View file

@ -302,6 +302,9 @@ Many Magit faces inherit from this one by default."
(defvar magit-completing-read 'completing-read (defvar magit-completing-read 'completing-read
"Function to be called when requesting input from the user.") "Function to be called when requesting input from the user.")
(defvar magit-read-rev-history nil
"The history of inputs to `magit-read-rev'.")
(defvar magit-omit-untracked-dir-contents nil (defvar magit-omit-untracked-dir-contents nil
"When non-nil magit will only list an untracked directory, not its contents.") "When non-nil magit will only list an untracked directory, not its contents.")
@ -468,7 +471,7 @@ Many Magit faces inherit from this one by default."
dirs)))) dirs))))
(defun magit-get-top-dir (cwd) (defun magit-get-top-dir (cwd)
(let ((cwd (expand-file-name cwd))) (let ((cwd (expand-file-name (file-truename cwd))))
(when (file-directory-p cwd) (when (file-directory-p cwd)
(let* ((default-directory cwd) (let* ((default-directory cwd)
(cdup (magit-git-string "rev-parse" "--show-cdup"))) (cdup (magit-git-string "rev-parse" "--show-cdup")))
@ -587,7 +590,7 @@ return nil."
(format "%s: " prompt))) (format "%s: " prompt)))
(interesting-refs (magit-list-interesting-refs)) (interesting-refs (magit-list-interesting-refs))
(reply (funcall magit-completing-read prompt interesting-refs (reply (funcall magit-completing-read prompt interesting-refs
nil nil nil nil def)) nil nil nil 'magit-read-rev-history def))
(rev (or (cdr (assoc reply interesting-refs)) reply))) (rev (or (cdr (assoc reply interesting-refs)) reply)))
(if (string= rev "") (if (string= rev "")
nil nil
@ -4030,7 +4033,12 @@ Return values:
(defun magit--branch-name-from-line (line) (defun magit--branch-name-from-line (line)
"Extract the branch name from line LINE of 'git branch' output." "Extract the branch name from line LINE of 'git branch' output."
(get-text-property 0 'branch-name line)) (let ((branch (get-text-property 0 'branch-name line)))
(if (and branch
(get-text-property 0 'remote line)
(string-match-p "^remotes/" branch))
(substring branch 8)
branch)))
(defun magit--branch-name-at-point () (defun magit--branch-name-at-point ()
"Get the branch name in the line at point." "Get the branch name in the line at point."
@ -4089,7 +4097,8 @@ With prefix force the removal even it it hasn't been merged."
) )
branch-line) branch-line)
(let ((res (list (cons 'current (match-string 1 branch-line)) (let ((res (list (cons 'current (match-string 1 branch-line))
(cons 'branch (match-string 2 branch-line))))) (cons 'branch (match-string 2 branch-line))
(cons 'remote (string-match-p "^remotes/" (match-string 2 branch-line))))))
(if (match-string 4 branch-line) (if (match-string 4 branch-line)
(cons (cons 'other-ref (match-string 6 branch-line)) res) (cons (cons 'other-ref (match-string 6 branch-line)) res)
(append (append