Преглед на файлове

Fix case when git root is passed (as dot or .. from deeper)

In that case (i.e. , the `${full#git_root}` would not work and print the full
basically full absolute path to git root.
Alois Mahdal преди 8 години
родител
ревизия
dd06fe56f8
променени са 1 файла, в които са добавени 1 реда и са изтрити 0 реда
  1. 1
    0
      dotfiles/gittum/bin/slurp

+ 1
- 0
dotfiles/gittum/bin/slurp Целия файл

@@ -41,6 +41,7 @@ git_relative() {
41 41
     local path="$1"
42 42
     test -n "$GIT_PREFIX" && path="$GIT_PREFIX/$path"
43 43
     local full=$(readlink -m "$path")
44
+    test "$full" = "$git_root" && echo . && return
44 45
     printf %s "${full#$git_root/}"
45 46
 }
46 47