public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: cygwin-apps <cygwin-apps@cygwin.com>
Subject: [PATCH cygport] git.cygclass: Try 'main' if there's no master branch
Date: Thu, 23 Mar 2023 10:07:43 -0400	[thread overview]
Message-ID: <ae7f3e37-fed6-bc36-f710-efc931122b38@cornell.edu> (raw)

[-- Attachment #1: Type: text/plain, Size: 15 bytes --]

Patch attached.

[-- Attachment #2: 0001-git.cygclass-Try-main-if-there-s-no-master-branch.patch --]
[-- Type: text/plain, Size: 1066 bytes --]

From 048a1e91cc9c4b14f4e17a6b52b6f4edb1843bf9 Mon Sep 17 00:00:00 2001
From: Ken Brown <kbrown@cornell.edu>
Date: Thu, 23 Mar 2023 09:20:14 -0400
Subject: [PATCH] git.cygclass: Try 'main' if there's no master branch

---
 cygclass/git.cygclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cygclass/git.cygclass b/cygclass/git.cygclass
index dd9aedbacdf2..e53a7985af99 100644
--- a/cygclass/git.cygclass
+++ b/cygclass/git.cygclass
@@ -93,7 +93,7 @@ git_fetch() {
 
 #****v* git.cygclass/GIT_BRANCH
 #  DESCRIPTION
-#  Branch from which to clone.  If undefined, the 'master' branch is used.
+#  Branch from which to clone.  If undefined, the 'master' or 'main' branch is used.
 #****
 #****v* git.cygclass/GIT_REV
 #  DESCRIPTION
@@ -116,7 +116,7 @@ git_fetch() {
 	then
 		verbose git checkout ${GIT_REV} || error "git checkout failed"
 	else
-		verbose git checkout master || error "git checkout failed"
+		verbose git checkout master || verbose git checkout main || error "git checkout failed"
 	fi
 
 	if [ -f .gitmodules ]
-- 
2.39.0


             reply	other threads:[~2023-03-23 14:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23 14:07 Ken Brown [this message]
2023-03-26 16:40 ` Jon Turney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ae7f3e37-fed6-bc36-f710-efc931122b38@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=cygwin-apps@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).