Skip to content

Commit

Permalink
Update prune untouched documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrie30 committed Sep 23, 2024
1 parent 3b110bf commit f76d38b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
7 changes: 3 additions & 4 deletions cmd/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -750,10 +750,9 @@ func CloneAllRepos(git git.Gitter, cloneTargets []scm.Repo) {
repoWillBePulled := repoExistsLocally(repo)

// Repos are considered untouched if
// 1. There are no new branches, ghorg only clones one branch so if there are more then the user has done something in the repo
// 2. If there are no branches locally, this means the repo is empty or all commits have been removed
// 3. If there are any commits on the default branch locally that are not on the remote
// 4. There are any modified changes locally
// 1. No new branches or zero branches
// 2. No new commits
// 3. No modified changes
if os.Getenv("GHORG_PRUNE_UNTOUCHED") == "true" && repoWillBePulled {
git.FetchCloneBranch(repo)

Expand Down
9 changes: 4 additions & 5 deletions sample-conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ GHORG_PRUNE: false
# flag (--prune-no-confirm)
GHORG_PRUNE_NO_CONFIRM: false

# Prune repositories that are considered untouched. A repository is considered untouched if:
# 1. There are no new branches, ghorg only clones one branch so if there are more then the user has done something in the repo
# 2. If there are no branches locally, this means the repo is empty or all commits have been removed
# 3. If there are any commits on the default branch locally that are not on the remote
# 4. There are any modified changes locally
# Prune repositories that are considered untouched. A repository is considered untouched if there are:
# 1. No new branches or zero branches
# 2. No new commits
# 3. No modified changes
# flag (--prune-untouched)
GHORG_PRUNE_UNTOUCHED: false

Expand Down

0 comments on commit f76d38b

Please sign in to comment.