mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 When rolling back a snapshot, a snapshot is created for the current data by default https://github.com/siyuan-note/siyuan/issues/12470
This commit is contained in:
parent
5de78d837d
commit
a2cf233aef
1 changed files with 10 additions and 0 deletions
|
|
@ -639,6 +639,16 @@ func checkoutRepo(id string) {
|
|||
Conf.Sync.Enabled = false
|
||||
Conf.Save()
|
||||
|
||||
// 回滚快照时默认为当前数据创建一个快照
|
||||
// When rolling back a snapshot, a snapshot is created for the current data by default https://github.com/siyuan-note/siyuan/issues/12470
|
||||
_, err = repo.Index("Backup before checkout", map[string]interface{}{eventbus.CtxPushMsg: eventbus.CtxPushMsgToStatusBarAndProgress})
|
||||
if err != nil {
|
||||
logging.LogErrorf("index repository failed: %s", err)
|
||||
util.PushClearProgress()
|
||||
util.PushErrMsg(fmt.Sprintf(Conf.Language(140), err), 0)
|
||||
return
|
||||
}
|
||||
|
||||
_, _, err = repo.Checkout(id, map[string]interface{}{eventbus.CtxPushMsg: eventbus.CtxPushMsgToStatusBarAndProgress})
|
||||
if err != nil {
|
||||
logging.LogErrorf("checkout repository failed: %s", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue