about summary refs log tree commit diff
path: root/Functions/VCS_Info/Backends/VCS_INFO_get_data_tla
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/VCS_Info/Backends/VCS_INFO_get_data_tla')
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_tla13
1 files changed, 13 insertions, 0 deletions
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_tla b/Functions/VCS_Info/Backends/VCS_INFO_get_data_tla
new file mode 100644
index 000000000..e1921725f
--- /dev/null
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_tla
@@ -0,0 +1,13 @@
+## vim:ft=zsh
+## gnu arch support by: Frank Terbeck <ft@bewatermyfriend.org>
+## Distributed under the same BSD-ish license as zsh itself.
+
+setopt localoptions extendedglob NO_shwordsplit
+local tlabase tlabranch
+
+tlabase="$(VCS_INFO_realpath ${vcs_comm[basedir]})"
+rrn=${tlabase:t}
+# tree-id gives us something like 'foo@example.com/demo--1.0--patch-4', so:
+tlabranch=${${"$( tla tree-id )"}/*\//}
+VCS_INFO_formats '' "${tlabranch}" "${tlabase}"
+return 0