summaryrefslogtreecommitdiff
path: root/internal/sync/git_operations_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/sync/git_operations_test.go')
-rw-r--r--internal/sync/git_operations_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/internal/sync/git_operations_test.go b/internal/sync/git_operations_test.go
new file mode 100644
index 0000000..03ddb81
--- /dev/null
+++ b/internal/sync/git_operations_test.go
@@ -0,0 +1,19 @@
+package sync
+
+import "testing"
+
+func TestGitCommand_SetsDir(t *testing.T) {
+ cmd := gitCommand("/tmp/example-repo", "status")
+
+ if cmd.Dir != "/tmp/example-repo" {
+ t.Fatalf("expected command dir to be set, got %q", cmd.Dir)
+ }
+}
+
+func TestGitCommand_LeavesDirEmptyForGlobalCommands(t *testing.T) {
+ cmd := gitCommand("", "ls-remote", "--tags", "origin", "v1.0.0")
+
+ if cmd.Dir != "" {
+ t.Fatalf("expected empty dir for global command, got %q", cmd.Dir)
+ }
+}