mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
fix(repo): sync a branch without switching to it
tea repo sync ran git switch on the synced branch, so syncing main while on experiment left the user on main. A branch that is not checked out now moves with update-ref, guarded by its old value; the checked-out branch merges with --ff-only and needs a clean working tree; a missing branch is created and set to track the remote. Diverged branches stay untouched. Sync reports "✓ Synced main from origin/main (fast-forward a..b)" on a terminal, "already up to date" when nothing changed, and the JSON result gains the previous commit. Outside a clone, or without a remote for the repository, the errors now name repo sync instead of checkout. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
6 files changed
+387
-188
No files matched your search
@@ -514,7 +514,6 @@ const (
|
||||
repo list
|
||||
repo migrate
|
||||
repo set-default
|
||||
repo sync
|
||||
repo view
|
||||
search issue
|
||||
search pr
|
||||
|
||||
Reference in new issue
Block a user