Don't use / as separatar since it is common i branch names
[stgit] / contrib / stgbashprompt.sh
index 16bb39b..5927e67 100755 (executable)
@@ -8,9 +8,9 @@ if [ "$PS1" ]; then
                git_dir=$(git-rev-parse --git-dir 2> /dev/null) || return
                ref=$(git-symbolic-ref HEAD 2> /dev/null) || return
                br=${ref#refs/heads/}
-               top=$(cat $git_dir/patches/$br/current 2>/dev/null) \
-                       && top="/$top"
-               echo "[$br$top]"
+               top=$(tail -n 1 $git_dir/patches/$br/applied 2>/dev/null) \
+               top=${top:-(none)}
+               echo "[$top@$br]"
        }
        PS1='\u@\h:$(__prompt_git)\W\$ '
 fi