summaryrefslogtreecommitdiff
blob: 6c85345e9460f292bc1ba3e3da53c3e0299da44d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Fix byte-compile failure with Emacs 24.3.91.

The upstream git repo has a more complicated fix which we don't use,
because the Gentoo package need not care about Emacs 22 and XEmacs
compatibility. Instead, always define magit-delete-directory as an
alias of delete-directory. This will work for all supported Emacs
versions.

--- magit-1.2.0-orig/magit.el
+++ magit-1.2.0/magit.el
@@ -775,21 +775,7 @@
                 after-change-functions)
             ,@body)))))
 
-  (if (>= (magit-max-args-internal 'delete-directory) 2)
-      (defalias 'magit-delete-directory 'delete-directory)
-    (defun magit-delete-directory (directory &optional recursive)
-      "Deletes a directory named DIRECTORY.  If RECURSIVE is non-nil,
-recursively delete all of DIRECTORY's contents as well.
-
-Does not follow symlinks."
-      (if (or (file-symlink-p directory)
-              (not (file-directory-p directory)))
-          (delete-file directory)
-        (if recursive
-            ;; `directory-files-no-dot-files-regex' borrowed from Emacs 23
-            (dolist (file (directory-files directory 'full "\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"))
-              (magit-delete-directory file recursive)))
-        (delete-directory directory)))))
+  (defalias 'magit-delete-directory 'delete-directory))
 
 ;;; Utilities