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

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

[elpa] externals/gited 09c79b9 64/73: Separate versions from file names


From: Stefan Monnier
Subject: [elpa] externals/gited 09c79b9 64/73: Separate versions from file names with --
Date: Sun, 29 Nov 2020 00:00:40 -0500 (EST)

branch: externals/gited
commit 09c79b95f4b468d0bcce872112920adb4e44d843
Author: Tino Calancha <tino.calancha@gmail.com>
Commit: Tino Calancha <tino.calancha@gmail.com>

    Separate versions from file names with --
    
    Bump version to v0.5.4
    * packages/gited/gited.el (gited-diff):
    Add separator (--) after versions.
    
    * packages/gited/gited-tests.el (gited-diff-test): Add test.
---
 gited-tests.el | 14 ++++++++++++++
 gited.el       |  5 ++---
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/gited-tests.el b/gited-tests.el
index e72e32e..fff6de5 100644
--- a/gited-tests.el
+++ b/gited-tests.el
@@ -198,6 +198,20 @@ Return the last evaled BODY form."
       (delete-directory dir1 'recursive)
       (delete-directory dir2 'recursive))))
 
+(ert-deftest gited-diff-test ()
+  "Test for `gited-diff'.
+Create a repository with 2 identical branches, `master' and `foo'.
+Each branch contains just one file `foo'.  Since this file has same name as one
+of the branches, then we must add '--' after the versions.
+For example, the Git command to get the diff between the 2 branches is as 
follows:
+git diff master foo --."
+  (skip-unless (executable-find vc-git-program))
+  (let ((dir (make-temp-file "gited" 'dir))
+        (inhibit-message t))
+    (with-gited-repo dir
+      (gited-copy-branch "master" gited-initial-filename)
+      (with-specified-completion-branch gited-initial-filename
+        (should-not (gited-diff "master"))))))
 
 (provide 'gited-tests)
 ;;; gited-tests.el ends here
diff --git a/gited.el b/gited.el
index 5900c7a..283e5cb 100644
--- a/gited.el
+++ b/gited.el
@@ -12,7 +12,7 @@
 ;; Package-Requires: ((emacs "24.4") (cl-lib "0.5"))
 ;; Last-Updated: Tue Jul 30 18:28:26 CEST 2019
 ;;           By: calancha
-;;     Update #: 697
+;;     Update #: 698
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;
@@ -1974,8 +1974,7 @@ diff OLD-REF REF."
     (with-current-buffer buf
       (let ((inhibit-read-only t))
         (erase-buffer)
-        (gited-git-command `("diff" ,old-ref ,ref)
-                           (current-buffer)))
+        (gited-git-command `("diff" ,old-ref ,ref "--") (current-buffer)))
       (display-buffer buf))
     (gited--set-output-buffer-mode buf 'diff)))
 



reply via email to

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