aboutsummaryrefslogtreecommitdiff
path: root/emacs/.emacs.d/lisp/my/my-magit.el
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/.emacs.d/lisp/my/my-magit.el')
-rw-r--r--emacs/.emacs.d/lisp/my/my-magit.el25
1 files changed, 14 insertions, 11 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-magit.el b/emacs/.emacs.d/lisp/my/my-magit.el
index efb3c84..eabed05 100644
--- a/emacs/.emacs.d/lisp/my/my-magit.el
+++ b/emacs/.emacs.d/lisp/my/my-magit.el
@@ -32,23 +32,26 @@
(require 'my-project)
(require 'org)
-(defun my-magit-clone-org-source (arg)
- (interactive "P")
- (let* ((url (or (org-entry-get (point) "Source")
- (org-entry-get (point) "Website")))
- (default-base-dir
- (alist-get "3p" my-projects-root-dirs nil nil 'string=))
+(defun my-magit-clone (url prefix-arg)
+ (let* ((default-base-dir
+ (alist-get "3p" my-projects-root-dirs nil nil 'string=))
(default-name
- (progn (string-match "^.*/\\(.*?\\)\\(\\.git\\)?$" url)
- (match-string 1 url)))
+ (progn (string-match "^.*/\\(.*?\\)\\(\\.git\\)?$" url)
+ (match-string 1 url)))
(dir (read-file-name
- (if arg "Clone to: " "Shallow clone to: ")
+ (if prefix-arg "Clone to: " "Shallow clone to: ")
(concat default-base-dir "/")
nil nil
default-name)))
- (if arg
+ (if prefix-arg
(magit-clone-regular url dir nil)
- (magit-clone-shallow url dir nil 1))
+ (magit-clone-shallow url dir nil 1))))
+
+(defun my-magit-clone-org-source (arg)
+ (interactive "P")
+ (let* ((url (or (org-entry-get (point) "Source")
+ (org-entry-get (point) "Website"))))
+ (my-magit-clone url arg)
(org-set-property "Local-source"
(format "<file:%s>" dir))))