Skip to content

Instantly share code, notes, and snippets.

@kyanagi
Created January 19, 2012 14:24
Show Gist options
  • Save kyanagi/1640254 to your computer and use it in GitHub Desktop.
Save kyanagi/1640254 to your computer and use it in GitHub Desktop.
optimize vcs_info on Cygwin
--- /usr/share/zsh/4.3.12/functions/VCS_INFO_bydir_detect 2011-08-08 04:59:41.001000000 +0900
+++ VCS_INFO_bydir_detect 2012-01-19 21:52:35.293434600 +0900
@@ -6,7 +6,7 @@
local dirname=$1
local basedir="." realbasedir file
-realbasedir="$(VCS_INFO_realpath ${basedir})"
+realbasedir="${basedir:A}"
while [[ ${realbasedir} != '/' ]]; do
[[ -r ${realbasedir} ]] || return 1
if [[ -n ${vcs_comm[detect_need_file]} ]] ; then
@@ -20,7 +20,7 @@
fi
basedir=${basedir}/..
- realbasedir="$(VCS_INFO_realpath ${basedir})"
+ realbasedir="${basedir:A}"
done
[[ ${realbasedir} == "/" ]] && return 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment