From 27d167b7a202cd1da39a731813df155dacb4c81b Mon Sep 17 00:00:00 2001 From: Foster Z <72973015+Foster0123@users.noreply.github.com> Date: Mon, 19 Dec 2022 00:03:01 +0530 Subject: [PATCH] fix(git_commit): fix potential test failure (#4734) Changes git command used in tests to avoid potential failures with lightweight tags. --- src/modules/git_commit.rs | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/modules/git_commit.rs b/src/modules/git_commit.rs index bb49dc89..122c27b5 100644 --- a/src/modules/git_commit.rs +++ b/src/modules/git_commit.rs @@ -373,16 +373,7 @@ mod tests { .output()?; let git_tag = create_command("git")? - .args([ - "for-each-ref", - "--contains", - "HEAD", - "--sort=-taggerdate", - "--count=1", - "--format", - "%(refname:short)", - "refs/tags", - ]) + .args(["describe", "--tags"]) .current_dir(repo_dir.path()) .output()? .stdout; @@ -443,16 +434,7 @@ mod tests { .output()?; let git_tag = create_command("git")? - .args([ - "for-each-ref", - "--contains", - "HEAD", - "--sort=-taggerdate", - "--count=1", - "--format", - "%(refname:short)", - "refs/tags", - ]) + .args(["describe", "--tags"]) .current_dir(repo_dir.path()) .output()? .stdout;