Skip to content

Commit

Permalink
patch: add checks for existing upstream remote and Git hooks rucio#7454
Browse files Browse the repository at this point in the history
Signed-off-by: Karanjot Singh <karanjot.singh@cern.ch>
  • Loading branch information
root authored and bari12 committed Mar 5, 2025
1 parent 3dfba03 commit d10519c
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions tools/configure_git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.

git remote add upstream https://github.com/rucio/rucio.git
# Check if the upstream remote already exists
if git remote get-url upstream &>/dev/null; then
echo "Remote 'upstream' already exists. Skipping addition."
else
echo "Adding remote 'upstream'..."
git remote add upstream https://github.com/rucio/rucio.git
fi

cp tools/prepare-commit-msg .git/hooks/prepare-commit-msg
chmod +x .git/hooks/prepare-commit-msg
# Set up the prepare-commit-msg hook
if [ -f .git/hooks/prepare-commit-msg ]; then
echo "Git hook 'prepare-commit-msg' already exists. Skipping copy."
else
echo "Setting up Git hook..."
cp tools/prepare-commit-msg .git/hooks/prepare-commit-msg
chmod +x .git/hooks/prepare-commit-msg
echo "Git hook installed successfully."
fi

0 comments on commit d10519c

Please sign in to comment.