OSDN Git Service

Don't pass invalid path to git-ls-tree
authormagicant <magicant@048f04df-13f5-43d7-8114-9f9ceecaec24>
Tue, 19 Jun 2018 13:00:18 +0000 (13:00 +0000)
committermagicant <magicant@048f04df-13f5-43d7-8114-9f9ceecaec24>
Tue, 19 Jun 2018 13:00:18 +0000 (13:00 +0000)
In recent versions of Git, the git-ls-tree command rejects the empty
path argument. We need to pass "." instead.

git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/yash/yash/trunk@3841 048f04df-13f5-43d7-8114-9f9ceecaec24

NEWS
NEWS.ja
share/completion/git

diff --git a/NEWS b/NEWS
index 7b6873f..4e47deb 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,8 @@ Yash 2.48
     *  Window title update should now work on more terminals.
     *  Any predefined handlers for SIGTSTP, SIGTTIN, and SIGTTOU are
        now cancelled so that jobs can be suspended properly.
+  .  Updated completion scripts:
+    *  git: pathnames are now correctly completed with the latest Git.
 
 ----------------------------------------------------------------------
 Yash 2.47
diff --git a/NEWS.ja b/NEWS.ja
index 1b37f24..1bdb0c6 100644 (file)
--- a/NEWS.ja
+++ b/NEWS.ja
@@ -14,6 +14,8 @@ Yash 2.48
     *  より多くの端末で動作するようウィンドウタイトルの設定方法を変更
     *  SIGTSTP, SIGTTIN, SIGTTOU でジョブが確実に停止するように
        シグナルの無視を明示的にキャンセルするようにした
+  .  補完スクリプトを更新:
+    *  git: 最新の Git でもファイルパスが正しく補完できるようにした
 
 ----------------------------------------------------------------------
 Yash 2.47
index fd36a6a..0cf5675 100644 (file)
@@ -1,4 +1,4 @@
-# (C) 2011-2017 magicant
+# (C) 2011-2018 magicant
 
 # Completion script for the "git" command.
 # Supports Git 2.9.2.
@@ -433,8 +433,7 @@ function completion/git::completepath {
                        (*)    opt= ;;
                esac
                complete -P "$PREFIX" $opt -- "${path##*/}"
-       done 2>/dev/null \
-               <(git ls-tree --full-tree "$tree" -- "$lspath")
+       done 2>/dev/null <(git ls-tree --full-tree "$tree" -- "${lspath:-.}")
 
 }