[PR #1530] [MERGED] Feature/allow worktrees #1988

Closed
opened 2026-03-01 21:53:33 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/1530
Author: @lavigne958
Created: 12/20/2022
Status: Merged
Merged: 1/19/2023
Merged by: @mergify[bot]

Base: masterHead: feature/allow_worktrees


📝 Commits (4)

  • e85f0d4 Use go-git to find remote URL
  • 3e97a20 Use go-git package to resolve HEAD revision (commit sha1)
  • 73074b9 Use go-git to find checked-out reference
  • 7a649a1 Remove unused functions

📊 Changes

2 files changed (+90 additions, -115 deletions)

View changed files

📝 pkg/common/git/git.go (+82 -114)
📝 pkg/common/git/git_test.go (+8 -1)

📄 Description

Handle cases where the user uses worktrees and not a regular git clone.

This PR uses some work previously done by @lvlrt and my contribution to make it work in any cases regardless of the type of worktrees.

this PR handle 2 cases:

  1. when the git dir is a regular git clone: so the worktree contains a file .git that contains the path to the git data inside the regular git clone. usually under: /path/to/repo/.git/worktrees/worktre_name
  2. When the git dir is a barre clone (so no actual files, only git data) and so the worktree contains a file .git that contains the path to the git data directly. usually under: /path/to/repo/commondir

This work fine, I tried it using both worktree types (actually both git clone types) and this code was pushed using a worktree and I managed to run act on it.

closes #657
Uses commits from #829


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/nektos/act/pull/1530 **Author:** [@lavigne958](https://github.com/lavigne958) **Created:** 12/20/2022 **Status:** ✅ Merged **Merged:** 1/19/2023 **Merged by:** [@mergify[bot]](https://github.com/apps/mergify) **Base:** `master` ← **Head:** `feature/allow_worktrees` --- ### 📝 Commits (4) - [`e85f0d4`](https://github.com/nektos/act/commit/e85f0d4b569e7228986665650fbb95a7a6c05406) Use go-git to find remote URL - [`3e97a20`](https://github.com/nektos/act/commit/3e97a2003340fddcc6c91df12ab4ebf678607e0e) Use go-git package to resolve HEAD revision (commit sha1) - [`73074b9`](https://github.com/nektos/act/commit/73074b9c4fad99210d87dbdd19a320627134fe71) Use go-git to find checked-out reference - [`7a649a1`](https://github.com/nektos/act/commit/7a649a166112626738a006d6074c3a17304677cf) Remove unused functions ### 📊 Changes **2 files changed** (+90 additions, -115 deletions) <details> <summary>View changed files</summary> 📝 `pkg/common/git/git.go` (+82 -114) 📝 `pkg/common/git/git_test.go` (+8 -1) </details> ### 📄 Description Handle cases where the user uses worktrees and not a regular git clone. This PR uses some work previously done by @lvlrt and my contribution to make it work in any cases regardless of the type of worktrees. this PR handle 2 cases: 1. when the git dir is a regular git clone: so the worktree contains a file `.git` that contains the path to the git data inside the regular git clone. usually under: `/path/to/repo/.git/worktrees/worktre_name` 2. When the git dir is a barre clone (so no actual files, only git data) and so the worktree contains a file `.git` that contains the path to the git data directly. usually under: `/path/to/repo/commondir` This work fine, I tried it using both worktree types (actually both git clone types) and this code was pushed using a worktree and I managed to run `act` on it. closes #657 Uses commits from #829 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:53:33 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#1988
No description provided.