Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installer: detect manually-configured default branch #515

Merged
merged 2 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions installer/install.iss
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,11 @@ begin
'true': RecordInferredDefault('Git Pull Behavior Option','Rebase');
'false': RecordInferredDefault('Git Pull Behavior Option','Merge');
end;
'init.defaultbranch':
if Value='master' then
RecordInferredDefault('Default Branch Option', ' ')
else
RecordInferredDefault('Default Branch Option', Value)
end;
end;
i:=j+1;
Expand Down
25 changes: 17 additions & 8 deletions installer/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,16 @@ CLANGARM64)
esac
MSYSTEM_LOWER=${MSYSTEM,,}

echo "Generating release notes to be included in the installer ..."
../render-release-notes.sh --css usr/share/git/ ||
if test -n "$page_id"
then
echo "Space intentionally left empty" >ReleaseNotes.html
else
echo "Generating release notes to be included in the installer ..."
../render-release-notes.sh --css usr/share/git/
fi ||
die "Could not generate release notes"

test ! -d /var/lib/pacman/local/ ||
if grep -q edit-git-bash /var/lib/pacman/local/mingw-w64-$ARCH-git-[1-9]*/files
then
INCLUDE_EDIT_GIT_BASH=
Expand Down Expand Up @@ -289,12 +295,15 @@ fi
# 3. Construct DeleteOpenSSHFiles function signature to be used in install.iss
# 4. Assemble function body and compile flag to be used as guard in install.iss
echo "$LIST" | sort >sorted-file-list.txt
pacman -Ql openssh 2>pacman.stderr | sed -n 's|^openssh /\(.*[^/]\)$|\1|p' | sort >sorted-openssh-file-list.txt
grep -v 'database file for .* does not exist' <pacman.stderr >&2
openssh_deletes="$(comm -12 sorted-file-list.txt sorted-openssh-file-list.txt |
sed -e 'y/\//\\/' -e "s|.*| if not DeleteFile(AppDir+'\\\\&') then\n Result:=False;|")"
inno_defines="$inno_defines$LF[Code]${LF}function DeleteOpenSSHFiles():Boolean;${LF}var$LF AppDir:String;${LF}begin$LF AppDir:=ExpandConstant('{app}');$LF Result:=True;"
inno_defines="$inno_defines$LF$openssh_deletes${LF}end;$LF#define DELETE_OPENSSH_FILES 1"
if type -p pacman.exe >/dev/null 2>&1
then
pacman -Ql openssh 2>pacman.stderr | sed -n 's|^openssh /\(.*[^/]\)$|\1|p' | sort >sorted-openssh-file-list.txt
grep -v 'database file for .* does not exist' <pacman.stderr >&2
openssh_deletes="$(comm -12 sorted-file-list.txt sorted-openssh-file-list.txt |
sed -e 'y/\//\\/' -e "s|.*| if not DeleteFile(AppDir+'\\\\&') then\n Result:=False;|")"
inno_defines="$inno_defines$LF[Code]${LF}function DeleteOpenSSHFiles():Boolean;${LF}var$LF AppDir:String;${LF}begin$LF AppDir:=ExpandConstant('{app}');$LF Result:=True;"
inno_defines="$inno_defines$LF$openssh_deletes${LF}end;$LF#define DELETE_OPENSSH_FILES 1"
fi

test -z "$LIST" ||
echo "$LIST" |
Expand Down