Pārlūkot izejas kodu

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 gadus atpakaļ
vecāks
revīzija
dd06fe56f8
1 mainītis faili ar 1 papildinājumiem un 0 dzēšanām
  1. 1
    0
      dotfiles/gittum/bin/slurp

+ 1
- 0
dotfiles/gittum/bin/slurp Parādīt failu

@@ -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