prompt: Clean up git.go
Anirudh Oppiliappan x@icyphox.sh
Mon, 09 Aug 2021 17:02:32 +0530
1 files changed,
2 insertions(+),
3 deletions(-)
jump to
M
prompt/git.go
→
prompt/git.go
@@ -22,7 +22,6 @@ }
} cwd = filepath.Dir(cwd) } - return "" } // Returns the current git branch or current ref sha.@@ -33,10 +32,10 @@ sha := h.Strings()[1]
if branch := filepath.Base(head); branch != "HEAD" { return branch } else { - // Detached HEAD state. + // Detached HEAD state; return the first 7 + // chars of commit sha. return sha[:7] } - return "" } // Returns • if clean, else ×.