* wrapper for git.exe
[lab.git] / misc / git.cmd
diff --git a/misc/git.cmd b/misc/git.cmd
new file mode 100644 (file)
index 0000000..a3b5a1c
--- /dev/null
@@ -0,0 +1,22 @@
+@echo off
+
+set DEFAULT=$P$G
+
+git.exe %*
+
+
+git.exe branch > NUL 2>&1
+if %ERRORLEVEL% EQU 128 goto norepos
+
+
+for /f "tokens=2" %%i in ('git branch') do set BRANCH=%%i
+prompt $P (%BRANCH%) $G
+
+goto end
+
+
+:norepos
+prompt %DEFAULT%
+
+
+:end