fix: getting askpass for every action even when it's not necessary (#1577)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo
2025-07-21 16:44:00 +08:00
parent 184ad00e19
commit 6822ae3e2e
7 changed files with 17 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
[Desktop Entry]
Name=SourceGit
Comment=Open-source & Free Git GUI Client
Exec=/opt/sourcegit/sourcegit
Exec=/usr/bin/sourcegit
Icon=/usr/share/icons/sourcegit.png
Terminal=false
Type=Application

View File

@@ -0,0 +1,4 @@
#!/bin/bash
eval `ssh-agent -s`
/opt/sourcegit/sourcegit $@

View File

@@ -0,0 +1,4 @@
#!/bin/bash
eval `ssh-agent -s`
"$APPDIR/opt/sourcegit/sourcegit" $@

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

View File

@@ -21,11 +21,12 @@ mkdir -p %{buildroot}/%{_bindir}
mkdir -p %{buildroot}/usr/share/applications
mkdir -p %{buildroot}/usr/share/icons
cp -f ../../../SourceGit/* %{buildroot}/opt/sourcegit/
ln -rsf %{buildroot}/opt/sourcegit/sourcegit %{buildroot}/%{_bindir}
cp -f ../../_common/sourcegit %{buildroot}/%{_bindir}
cp -r ../../_common/applications %{buildroot}/%{_datadir}
cp -r ../../_common/icons %{buildroot}/%{_datadir}
chmod 755 -R %{buildroot}/opt/sourcegit
chmod 755 %{buildroot}/%{_datadir}/applications/sourcegit.desktop
chmod 755 %{buildroot}/%{_bindir}/sourcegit
%files
%dir /opt/sourcegit/

View File

@@ -41,8 +41,9 @@ cp -r SourceGit SourceGit.AppDir/opt/sourcegit
desktop-file-install resources/_common/applications/sourcegit.desktop --dir SourceGit.AppDir/usr/share/applications \
--set-icon com.sourcegit_scm.SourceGit --set-key=Exec --set-value=AppRun
mv SourceGit.AppDir/usr/share/applications/{sourcegit,com.sourcegit_scm.SourceGit}.desktop
cp resources/appimage/sourcegit.png SourceGit.AppDir/com.sourcegit_scm.SourceGit.png
ln -rsf SourceGit.AppDir/opt/sourcegit/sourcegit SourceGit.AppDir/AppRun
cp resources/_common/icons/sourcegit.png SourceGit.AppDir/com.sourcegit_scm.SourceGit.png
cp -f resources/appimage/sourcegit SourceGit.AppDir/AppRun
chmod 755 SourceGit.AppDir/AppRun
ln -rsf SourceGit.AppDir/usr/share/applications/com.sourcegit_scm.SourceGit.desktop SourceGit.AppDir
cp resources/appimage/sourcegit.appdata.xml SourceGit.AppDir/usr/share/metainfo/com.sourcegit_scm.SourceGit.appdata.xml
@@ -53,9 +54,10 @@ mkdir -p resources/deb/usr/bin
mkdir -p resources/deb/usr/share/applications
mkdir -p resources/deb/usr/share/icons
cp -f SourceGit/* resources/deb/opt/sourcegit
ln -rsf resources/deb/opt/sourcegit/sourcegit resources/deb/usr/bin
cp -f resources/_common/sourcegit resources/deb/usr/bin/
cp -r resources/_common/applications resources/deb/usr/share
cp -r resources/_common/icons resources/deb/usr/share
chmod 755 resources/deb/usr/bin/sourcegit
# Calculate installed size in KB
installed_size=$(du -sk resources/deb | cut -f1)
# Update the control file

View File

@@ -172,7 +172,7 @@ namespace SourceGit.Commands
// If an SSH private key was provided, sets the environment.
if (!start.Environment.ContainsKey("GIT_SSH_COMMAND") && !string.IsNullOrEmpty(SSHKey))
start.Environment.Add("GIT_SSH_COMMAND", $"ssh -i '{SSHKey}'");
start.Environment.Add("GIT_SSH_COMMAND", $"ssh -o AddKeysToAgent=yes -i {SSHKey.Quoted()}");
// Force using en_US.UTF-8 locale
if (OperatingSystem.IsLinux())