@befe/vault-system 0.1.19 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALL.md +1 -1
- package/package.json +1 -1
- package/src/core/local-branch.ts +5 -3
package/INSTALL.md
CHANGED
package/package.json
CHANGED
package/src/core/local-branch.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 口径见 ref#qa_服务端git接口.261120_4ipuk7_ctag. 与 ref#qa_是否先fetch.261120_rstfx9_ctag.:
|
|
5
5
|
* - 只比一件事:外层工作区仓的本地当前分支(HEAD)对 origin/master,基线写死,不带参数
|
|
6
|
-
* - `git rev-list --left-right --count origin/master...HEAD` 输出「落后 超前」(左边只在远端、右边只在本地),
|
|
7
|
-
* 这里反着映射成 behind / ahead
|
|
6
|
+
* - `git rev-list --left-right --count --no-merges origin/master...HEAD` 输出「落后 超前」(左边只在远端、右边只在本地),
|
|
7
|
+
* 这里反着映射成 behind / ahead;merge 提交本身不计入,否则网页 --no-ff 合并后接收侧会长期显示落后
|
|
8
8
|
* - 服务内存里记「最近一次成功 fetch 的时间」:距上次成功超过 1 小时(含从未 fetch 过)先
|
|
9
9
|
* `git fetch --quiet origin master`;不到 1 小时直接读本地引用,不改该时间。`force` 忽略 1 小时判断
|
|
10
10
|
* - fetch 失败(含超时)就是没拿到数据:ok:false + offline / timeout,不拿本地旧引用兜底,也不更新最近成功时间
|
|
@@ -239,7 +239,9 @@ export async function getGitStatus(wk: string, opts: GitStatusOptions = {}): Pro
|
|
|
239
239
|
|
|
240
240
|
const [branch, counts] = await Promise.all([
|
|
241
241
|
git(['rev-parse', '--abbrev-ref', 'HEAD']),
|
|
242
|
-
|
|
242
|
+
// --no-merges:merge 提交本身不算差异。网页走 --no-ff 合并后,接收侧会多一个 merge 提交,
|
|
243
|
+
// 不带这个参数就会一直显示落后,而内容其实已经同步。
|
|
244
|
+
git(['rev-list', '--left-right', '--count', '--no-merges', `${BASE_REF}...HEAD`]),
|
|
243
245
|
]);
|
|
244
246
|
if (!branch.ok) return fail(branch.timedOut ? 'timeout' : 'not-a-repo'); // 例如还没有任何提交的空仓
|
|
245
247
|
if (!counts.ok) return fail(counts.timedOut ? 'timeout' : 'not-a-repo');
|