[PR #267] [MERGED] Pull latest changes from ref using cached repo #1398

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

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/267
Author: @mheap
Created: 6/6/2020
Status: Merged
Merged: 6/9/2020
Merged by: @cplee

Base: masterHead: master


📝 Commits (3)

  • 63c041e Pull latest changes from ref using cached repo
  • 5456c83 Extract CloneIfRequired to reduce cyclomatic complexity
  • 411f5c1 Merge branch 'master' into master

📊 Changes

1 file changed (+81 additions, -30 deletions)

View changed files

📝 pkg/common/git.go (+81 -30)

📄 Description

Act switched from checking out a branch to checking out a hash in order to resolve #24 - see bc5c23e8e4

This had a side effect of preventing w.Pull() from updating to the latest commit if a ref was a branch/tag and the repo already exists on disk.

This commit checks if input.Ref is equivalent to the resolved hash, and runs r.Fetch() and checks out the branch for input.Ref if it is different. w.Pull() can then pull the latest changes before we checkout *hash again like normal


🔄 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/267 **Author:** [@mheap](https://github.com/mheap) **Created:** 6/6/2020 **Status:** ✅ Merged **Merged:** 6/9/2020 **Merged by:** [@cplee](https://github.com/cplee) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (3) - [`63c041e`](https://github.com/nektos/act/commit/63c041e45875cbe723ff81c3946ec7bcee5f2a24) Pull latest changes from ref using cached repo - [`5456c83`](https://github.com/nektos/act/commit/5456c8381f9e8dedcc37b2d82129cc178133e942) Extract CloneIfRequired to reduce cyclomatic complexity - [`411f5c1`](https://github.com/nektos/act/commit/411f5c1c7e5a8b79d7f2e141982e7db304dec967) Merge branch 'master' into master ### 📊 Changes **1 file changed** (+81 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `pkg/common/git.go` (+81 -30) </details> ### 📄 Description Act switched from checking out a branch to checking out a hash in order to resolve #24 - see bc5c23e8e48ee1886ac274965852196d1ec3ba3f This had a side effect of preventing `w.Pull()` from updating to the latest commit if a ref was a branch/tag and the repo already exists on disk. This commit checks if input.Ref is equivalent to the resolved hash, and runs `r.Fetch()` and checks out the branch for `input.Ref` if it is different. `w.Pull()` can then pull the latest changes before we checkout `*hash` again like normal --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:51:01 +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#1398
No description provided.