mktcms 0.2.11 → 0.2.12

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mktcms",
3
3
  "configKey": "mktcms",
4
- "version": "0.2.11",
4
+ "version": "0.2.12",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -10,8 +10,9 @@ function toStorageFilePath(file) {
10
10
  }
11
11
  export default async function syncGitContent(commitMessage, files) {
12
12
  const { git, authUrl } = createAuthenticatedGitClient();
13
+ const currentBranch = (await git.branchLocal()).current;
13
14
  try {
14
- await git.raw(["pull", "--rebase", "--autostash", authUrl]);
15
+ await git.raw(["pull", "--rebase", "--autostash", authUrl, currentBranch]);
15
16
  } catch (error) {
16
17
  throw new Error(toGitErrorMessage(error, "Git pull failed"));
17
18
  }
@@ -27,16 +28,15 @@ export default async function syncGitContent(commitMessage, files) {
27
28
  throw new Error(toGitErrorMessage(error, "Git commit failed"));
28
29
  }
29
30
  try {
30
- await git.push([authUrl]);
31
+ await git.push([authUrl, `HEAD:${currentBranch}`]);
31
32
  } catch (error) {
32
33
  throw new Error(toGitErrorMessage(error, "Git push failed"));
33
34
  }
34
35
  try {
35
- const currentBranch = (await git.branchLocal()).current;
36
36
  const remotes = await git.getRemotes(true);
37
37
  const hasOriginRemote = remotes.some((remote) => remote.name === "origin");
38
38
  if (hasOriginRemote) {
39
- await git.fetch(["--prune", "origin", currentBranch]);
39
+ await git.raw(["update-ref", `refs/remotes/origin/${currentBranch}`, "HEAD"]);
40
40
  }
41
41
  } catch (error) {
42
42
  throw new Error(toGitErrorMessage(error, "Git status refresh failed"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mktcms",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "description": "Simple CMS module for Nuxt",
5
5
  "repository": "mktcode/mktcms",
6
6
  "license": "MIT",