Skip to content

Commit

Permalink
Fix specs broken by #668
Browse files Browse the repository at this point in the history
  • Loading branch information
aramprice committed Oct 17, 2024
1 parent df5b5b7 commit 4a67b0b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion releasedir/git_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ releases/**/*.tgz
func (r FSGitRepo) LastCommitSHA() (string, error) {
cmd := boshsys.Command{
Name: "git",
Args: []string{"rev-parse", "--short", "HEAD"},
Args: []string{"rev-parse", "--porcelain=1", "HEAD"},
WorkingDir: r.dirPath,
}
stdout, stderr, _, err := r.runner.RunComplexCommand(cmd)
Expand Down
12 changes: 6 additions & 6 deletions releasedir/git_repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ releases/**/*.tgz
})

Describe("LastCommitSHA", func() {
cmd := "git rev-parse --short HEAD"
cmd := "git rev-parse --porcelain=1 HEAD"

It("returns last commit", func() {
cmdRunner.AddCmdResult(cmd, fakesys.FakeCmdResult{
Expand All @@ -81,7 +81,7 @@ releases/**/*.tgz

Expect(cmdRunner.RunComplexCommands).To(Equal([]boshsys.Command{{
Name: "git",
Args: []string{"rev-parse", "--short", "HEAD"},
Args: []string{"rev-parse", "--porcelain=1", "HEAD"},
WorkingDir: "/dir",
}}))
})
Expand All @@ -91,7 +91,7 @@ releases/**/*.tgz
Expect(err).ToNot(HaveOccurred())
cmdRunner.AddCmdResult(cmd, fakesys.FakeCmdResult{
Stderr: "fatal: Not a git repository: '/dir/.git'\n",
Error: errors.New("not a git repo (--short HEAD)"),
Error: errors.New("not a git repo (--porcelain=1 HEAD)"),
})
cmdRunner.AddCmdResult("git rev-parse --git-dir", fakesys.FakeCmdResult{
Stderr: "fatal: Not a git repository: '/dir/.git'\n",
Expand Down Expand Up @@ -123,7 +123,7 @@ releases/**/*.tgz
})

Describe("MustNotBeDirty", func() {
cmd := "git status --short"
cmd := "git status --porcelain=1"

It("returns false if there are no changes", func() {
cmdRunner.AddCmdResult(cmd, fakesys.FakeCmdResult{Stdout: ""})
Expand All @@ -133,7 +133,7 @@ releases/**/*.tgz

Expect(cmdRunner.RunComplexCommands).To(Equal([]boshsys.Command{{
Name: "git",
Args: []string{"status", "--short"},
Args: []string{"status", "--porcelain=1"},
WorkingDir: "/dir",
}}))
})
Expand All @@ -158,7 +158,7 @@ releases/**/*.tgz
Expect(err).ToNot(HaveOccurred())
cmdRunner.AddCmdResult(cmd, fakesys.FakeCmdResult{
Stderr: "fatal: not a git repository: '/dir/.git'\n",
Error: errors.New("not a git repo (--short HEAD)"),
Error: errors.New("not a git repo (--porcelain=1 HEAD)"),
})
cmdRunner.AddCmdResult("git rev-parse --git-dir", fakesys.FakeCmdResult{
Stderr: "fatal: not a git repository: '/dir/.git'\n",
Expand Down

0 comments on commit 4a67b0b

Please sign in to comment.