relq 1.0.54 → 1.0.55

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.
@@ -65,7 +65,14 @@ async function syncCommand(context) {
65
65
  const remoteCommits = await (0, repo_manager_1.fetchRemoteCommits)(connection, 100);
66
66
  const remoteHashes = new Set(remoteCommits.map(c => c.hash));
67
67
  const localCommitsAfter = (0, repo_manager_1.getAllCommits)(projectRoot);
68
- const toPush = localCommitsAfter.filter(c => !remoteHashes.has(c.hash));
68
+ const toPush = localCommitsAfter.filter(c => {
69
+ if (remoteHashes.has(c.hash))
70
+ return false;
71
+ const syncStatus = (0, repo_manager_1.isCommitSyncedWith)(c, connection);
72
+ if (syncStatus.synced)
73
+ return false;
74
+ return true;
75
+ });
69
76
  if (toPush.length === 0) {
70
77
  (0, cli_utils_1.success)('Sync complete - up to date');
71
78
  console.log('');
@@ -3,7 +3,7 @@ import * as path from 'path';
3
3
  import { requireValidConfig } from "../utils/config-loader.js";
4
4
  import { getConnectionDescription } from "../utils/env-loader.js";
5
5
  import { colors, createSpinner, fatal, success } from "../utils/cli-utils.js";
6
- import { isInitialized, initRepository, shortHash, fetchRemoteCommits, pushCommit, ensureRemoteTable, getAllCommits, markCommitAsApplied, markCommitAsPushed, getConnectionLabel, } from "../utils/repo-manager.js";
6
+ import { isInitialized, initRepository, shortHash, fetchRemoteCommits, pushCommit, ensureRemoteTable, getAllCommits, markCommitAsApplied, markCommitAsPushed, getConnectionLabel, isCommitSyncedWith, } from "../utils/repo-manager.js";
7
7
  import { pullCommand } from "./pull.js";
8
8
  export async function syncCommand(context) {
9
9
  const { config, flags } = context;
@@ -29,7 +29,14 @@ export async function syncCommand(context) {
29
29
  const remoteCommits = await fetchRemoteCommits(connection, 100);
30
30
  const remoteHashes = new Set(remoteCommits.map(c => c.hash));
31
31
  const localCommitsAfter = getAllCommits(projectRoot);
32
- const toPush = localCommitsAfter.filter(c => !remoteHashes.has(c.hash));
32
+ const toPush = localCommitsAfter.filter(c => {
33
+ if (remoteHashes.has(c.hash))
34
+ return false;
35
+ const syncStatus = isCommitSyncedWith(c, connection);
36
+ if (syncStatus.synced)
37
+ return false;
38
+ return true;
39
+ });
33
40
  if (toPush.length === 0) {
34
41
  success('Sync complete - up to date');
35
42
  console.log('');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relq",
3
- "version": "1.0.54",
3
+ "version": "1.0.55",
4
4
  "description": "The Fully-Typed PostgreSQL ORM for TypeScript",
5
5
  "author": "Olajide Mathew O. <olajide.mathew@yuniq.solutions>",
6
6
  "license": "MIT",