Skip to content

Commit

Permalink
fix(collect-updates): Do not skip change detection when --since pro…
Browse files Browse the repository at this point in the history
…vided

Fixes #1927
  • Loading branch information
evocateur committed Feb 14, 2019
1 parent e2cc514 commit 6ff53d6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions utils/collect-updates/__tests__/collect-updates.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,29 @@ describe("collectUpdates()", () => {
expect(makeDiffPredicate).toHaveBeenLastCalledWith("beefcafe", execOpts, undefined);
});

it("does not exit early on tagged release when --since <ref> is passed", () => {
changedPackages.add("package-dag-1");

describeRef.sync.mockReturnValueOnce({
refCount: "0",
});

const graph = buildGraph();
const pkgs = graph.rawPackageList;
const execOpts = { cwd: "/test" };

const updates = collectUpdates(pkgs, graph, execOpts, {
since: "deadbeef",
});

expect(updates).toEqual([
expect.objectContaining({ name: "package-dag-1" }),
expect.objectContaining({ name: "package-dag-2a" }),
expect.objectContaining({ name: "package-dag-2b" }),
expect.objectContaining({ name: "package-dag-3" }),
]);
});

it("ignores changes matched by --ignore-changes", () => {
const graph = buildGraph();
const pkgs = graph.rawPackageList;
Expand Down
2 changes: 1 addition & 1 deletion utils/collect-updates/collect-updates.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function collectUpdates(filteredPackages, packageGraph, execOpts, commandOptions
const { sha, refCount, lastTagName } = describeRef.sync(execOpts, commandOptions.includeMergedTags);
// TODO: warn about dirty tree?

if (refCount === "0" && forced.size === 0) {
if (refCount === "0" && forced.size === 0 && !committish) {
// no commits since previous release
log.notice("", "Current HEAD is already released, skipping change detection.");

Expand Down

0 comments on commit 6ff53d6

Please sign in to comment.