[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vc-got f8a9db5 060/145: fix vc-got-repository-url for c
From: |
ELPA Syncer |
Subject: |
[elpa] externals/vc-got f8a9db5 060/145: fix vc-got-repository-url for checkout of non-bare repos |
Date: |
Thu, 9 Sep 2021 15:58:33 -0400 (EDT) |
branch: externals/vc-got
commit f8a9db5613417ffb30e54495f6a83c2f8a64dfe2
Author: Omar Polo <op@omarpolo.com>
Commit: Omar Polo <op@omarpolo.com>
fix vc-got-repository-url for checkout of non-bare repos
before I assumed got could checkout only from bare repos, but it turns
out this isn't the case. This fixes it, making vc-got-repository-url
more robust. It first try to use .git/config if it exists, if it
doesn't but there is a .git directory, don't do anything; finally try
to parse config (assuming this is a bare repo).
---
vc-got.el | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/vc-got.el b/vc-got.el
index 19f04bb..8440bf5 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -651,17 +651,24 @@ Value is returned as floating point fractional number of
days."
(let* ((default-directory (vc-got--repo-root))
(remote-name (or remote-name "origin"))
(heading (concat "[remote \"" remote-name "\"]"))
+ (conf (cond ((file-exists-p ".git/config")
+ ".git/config")
+ ((file-exists-p ".git")
+ nil)
+ ((file-exists-p "config")
+ "config")))
found)
(with-temp-buffer
- (insert-file-contents "config")
- (goto-char (point-min))
- (when (search-forward heading nil t)
- (forward-line)
- (while (and (not found)
- (looking-at ".*=")) ;too broad?
- (when (looking-at ".*url = \\(.*\\)")
- (setq found (match-string-no-properties 1))))
- found))))
+ (when conf
+ (insert-file-contents conf)
+ (goto-char (point-min))
+ (when (search-forward heading nil t)
+ (forward-line)
+ (while (and (not found)
+ (looking-at ".*=")) ;too broad?
+ (when (looking-at ".*url = \\(.*\\)")
+ (setq found (match-string-no-properties 1))))
+ found)))))
(provide 'vc-got)
;;; vc-got.el ends here
- [elpa] externals/vc-got 1b2afa9 121/145: rework the vc-dir handling and remove the ugly hack, (continued)
- [elpa] externals/vc-got 1b2afa9 121/145: rework the vc-dir handling and remove the ugly hack, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 2552a6c 104/145: mark find-ignore-file as done and move it to the right place, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 26b39de 135/145: remove debug macroexpand, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 84beb0d 129/145: add docstring for vc-got-update-on-retrieve-tag, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got a1839dc 131/145: don't include the common commit in log-outgoing, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 74b0000 138/145: install a custom process filter for `got send', ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 3efc759 141/145: cleanup, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got f457868 024/145: typo, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 06d4d37 031/145: add Makefile, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got ddc59a0 057/145: remove extra parens from vc-got-unregister and fix pcase matchall, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got f8a9db5 060/145: fix vc-got-repository-url for checkout of non-bare repos,
ELPA Syncer <=
- [elpa] externals/vc-got 9e01941 078/145: improve vc-dir presentation & document vc-got-stage in README, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got a7777ea 079/145: list also staged addition/removals, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 668dc8e 068/145: vc-got--status: handle stage info and filter result, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 7a5ead6 061/145: vc-got-repository-url: avoid infinite loops in parsing, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 0d57aba 072/145: remove the separator when showing a chunk to stage, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got d346ca6 084/145: ignore ignored files, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 67e0b4d 096/145: add note for the future, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 6ab1c7b 102/145: implement the tag creation part of vc-got-create-tag, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 887e069 090/145: make files an optional parameter, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 7726b6c 097/145: silence some checkdoc warnings, ELPA Syncer, 2021/09/09