Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Core
Tor
Commits
995618ec
Unverified
Commit
995618ec
authored
5 years ago
by
teor
Browse files
Options
Downloads
Patches
Plain Diff
scripts/git: Make a master symlink in the worktree directory
When running git-setup-dirs.sh. Part of 32347.
parent
e046903f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/git/git-setup-dirs.sh
+25
-1
25 additions, 1 deletion
scripts/git/git-setup-dirs.sh
with
25 additions
and
1 deletion
scripts/git/git-setup-dirs.sh
+
25
−
1
View file @
995618ec
...
...
@@ -254,6 +254,25 @@ function make_directory
fi
}
# Create a symlink from the first argument to the second argument
# If the link already exists: fail if $USE_EXISTING is 0, otherwise skip.
function
make_symlink
{
local
cmd
=
"ln -s '
$1
' '
$2
'"
printf
" %s Creating symlink from %s to %s..."
"
$MARKER
"
"
$1
"
"
$2
"
local
check_cmd
=
"[ ! -e '
$2
' ]"
msg
=
$(
eval
"
$check_cmd
"
2>&1
)
if
validate_ret_skip
$?
"File already exists."
;
then
return
fi
if
[
$DRY_RUN
-eq
0
]
;
then
msg
=
$(
eval
"
$cmd
"
2>&1
)
validate_ret
$?
"
$msg
"
else
printf
"
\\
n %s
\\
n"
"
${
IWTH
}
$cmd
${
CNRM
}
"
fi
}
# Go into the directory or repository, even if $DRY_RUN is non-zero.
# If the directory does not exist, fail and log an error.
# Otherwise, silently succeed.
...
...
@@ -496,7 +515,12 @@ for ((i=0; i<COUNT; i++)); do
printf
"%s Handling branch %s
\\
n"
"
$MARKER
"
"
${
BYEL
}
$branch
${
CNRM
}
"
# We cloned the repository, and master is the default branch
if
[
"
$branch
"
!=
"master"
]
;
then
if
[
"
$branch
"
=
"master"
]
;
then
if
[
"
$TOR_MASTER_NAME
"
!=
"master"
]
;
then
# Set up a master link in the worktree directory
make_symlink
"
$repo_path
"
"
$GIT_PATH
/
$TOR_WKT_NAME
/master"
fi
else
# git makes worktree directories if they don't exist
add_worktree
"origin/
$branch
"
"
$repo_path
"
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment