emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] elpa-admin f3249bc: Revert "* elpa-admin.el (elpaa--pull): Don't


From: Jonas Bernoulli
Subject: [elpa] elpa-admin f3249bc: Revert "* elpa-admin.el (elpaa--pull): Don't update if upstream is missing"
Date: Wed, 3 Nov 2021 13:54:37 -0400 (EDT)

branch: elpa-admin
commit f3249bc02d5638f62d04d813afff0b50b34623f7
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Revert "* elpa-admin.el (elpaa--pull): Don't update if upstream is missing"
    
    This reverts commit 7c525ccba1f7f380f46bcc364c78d4e6bf831652.
    
    This tried to use the match-data before setting it.
---
 elpa-admin.el | 27 ++++++++++++---------------
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/elpa-admin.el b/elpa-admin.el
index 036568b..c3fde34 100644
--- a/elpa-admin.el
+++ b/elpa-admin.el
@@ -1509,13 +1509,11 @@ arbitrary code."
         (message "Running git pull in %S" default-directory)
         (elpaa--call t "git" "pull"))
        ((file-exists-p ".git")          ;A worktree, presumably.
-        (let* ((status
-               (with-temp-buffer
-                  (let ((elpaa--debug nil))
-                    (elpaa--call t "git" "status" "--branch" "--porcelain=2"))
-                  (buffer-string)))
-              (br (match-string 1 status))
-               (ortb (concat "refs/remotes/origin/" br)))
+        (let ((status
+               (with-temp-buffer
+                 (let ((elpaa--debug nil))
+                   (elpaa--call t "git" "status" "--branch" "--porcelain=2"))
+                 (buffer-string))))
           (if (string-match (regexp-quote "\n# branch.ab +0 -0") status)
               (elpaa--message "%s up-to-date" dirname)
             ;; Set upstream if applicable.
@@ -1528,14 +1526,13 @@ arbitrary code."
                             (regexp-quote elpaa--branch-prefix)
                             ".*\\)")
                     status))
-              ;; There is an upstream to set it to!
-              (when (elpaa--git-branch-p ortb)
-                (elpaa--call t "git" "branch" "--set-upstream-to" ortb)))
-           (if (elpaa--git-branch-p ortb)
-               (progn
-                 (message "Updating worktree in %S" default-directory)
-                 (elpaa--call t "git" "merge"))
-             (message "Not pushed to origin yet.  Not updating worktree")))))
+              (let* ((br (match-string 1 status))
+                     (ortb (concat "refs/remotes/origin/" br)))
+                ;; There is an upstream to set it to!
+                (when (elpaa--git-branch-p ortb)
+                  (elpaa--call t "git" "branch" "--set-upstream-to" ortb))))
+            (message "Updating worktree in %S" default-directory)
+            (elpaa--call t "git" "merge"))))
        (t (error "No .git in %S" default-directory)))
       (unless (and (eobp) (bobp))
         (message "Updated %s:%s%s" dirname



reply via email to

[Prev in Thread] Current Thread [Next in Thread]