소스 검색

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 9 년 전
부모
커밋
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