Skip to content

Commit 95a855d

Browse files
committed
try branch
1 parent 6eb3061 commit 95a855d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/test/update.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ if git ls-remote --exit-code origin "$BKG_INDEX" &>/dev/null; then
4848
[ -d "$BKG_INDEX".bak ] || rm -rf "$BKG_INDEX".bak
4949
git worktree move "$BKG_INDEX" "$BKG_INDEX".bak &>/dev/null
5050
git fetch --depth=1 origin "$BKG_INDEX"
51+
git branch --track -f "$BKG_INDEX" "origin/$BKG_INDEX" 2>/dev/null || git branch -f "$BKG_INDEX" "origin/$BKG_INDEX"
5152
BKG_IS_FIRST=true
5253
else
5354
fd_list=$(find . -type f -o -type d | grep -vE "^\.($|\/(\.git\/*|.*\.md$))")
@@ -62,7 +63,7 @@ else
6263
fi
6364

6465
git worktree remove -f "$BKG_INDEX" 2>/dev/null
65-
git worktree add --track -f -B "$BKG_INDEX" "$BKG_INDEX" "origin/$BKG_INDEX"
66+
git worktree add -f "$BKG_INDEX" "$BKG_INDEX"
6667
[[ -d "$BKG_INDEX" || ! -d "$BKG_INDEX".bak ]] || git worktree move "$BKG_INDEX".bak "$BKG_INDEX"
6768
pushd "$BKG_INDEX" || exit 1
6869
git reset --hard origin/"$BKG_INDEX"

0 commit comments

Comments
 (0)