Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rename: remove git-credential-manager-core symlinks
Since 2 versions of Git have released since the rename of the executable
from git-credential-manager-core to git-credential-manager, remove the
associated symlinks and warnings, (as outlined in docs/rename.md).
  • Loading branch information
ldennington authored and Lessley Dennington committed Jul 12, 2023
commit 88cae6bc4d65ad478ccfebac65971c465486df53
6 changes: 0 additions & 6 deletions src/linux/Packaging.Linux/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ if [ $INSTALL_FROM_SOURCE = true ]; then
"$LINK_TO/git-credential-manager" || exit 1
fi

# Create legacy symlink with older name
if [ ! -f "$LINK_TO/git-credential-manager-core" ]; then
ln -s -r "$INSTALL_TO/git-credential-manager" \
"$LINK_TO/git-credential-manager-core" || exit 1
fi

echo "Install complete."
else
# Pack
Expand Down
6 changes: 0 additions & 6 deletions src/linux/Packaging.Linux/pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,6 @@ if [ ! -f "$LINK_TO/git-credential-manager" ]; then
"$LINK_TO/git-credential-manager" || exit 1
fi

# Create legacy symlink with older name
if [ ! -f "$LINK_TO/git-credential-manager-core" ]; then
ln -s -r "$INSTALL_TO/git-credential-manager" \
"$LINK_TO/git-credential-manager-core" || exit 1
fi

dpkg-deb -Zxz --build "$DEBROOT" "$DEBPKG" || exit 1

echo $MESSAGE
3 changes: 0 additions & 3 deletions src/osx/Installer.Mac/scripts/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ fi
mkdir -p /usr/local/bin
/bin/ln -Fs "$INSTALL_DESTINATION/git-credential-manager" /usr/local/bin/git-credential-manager

# Create legacy symlink to GCMCore in /usr/local/bin
/bin/ln -Fs "$INSTALL_DESTINATION/git-credential-manager" /usr/local/bin/git-credential-manager-core

# Configure GCM for the current user (running as the current user to avoid root
# from taking ownership of ~/.gitconfig)
sudo -u ${USER} "$INSTALL_DESTINATION/git-credential-manager" configure
Expand Down
1 change: 0 additions & 1 deletion src/shared/Core/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ public static class HelpUrls
public const string GcmCredentialStores = "https://aka.ms/gcm/credstores";
public const string GcmWamComSecurity = "https://aka.ms/gcm/wamadmin";
public const string GcmAutoDetect = "https://aka.ms/gcm/autodetect";
public const string GcmExecRename = "https://aka.ms/gcm/rename";
public const string GcmDefaultAccount = "https://aka.ms/gcm/defaultaccount";
public const string GcmMultipleUsers = "https://aka.ms/gcm/multipleusers";
}
Expand Down
30 changes: 0 additions & 30 deletions src/shared/Git-Credential-Manager/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,36 +55,6 @@ private static void AppMain(object o)
// Write the start and version events
context.Trace2.Start(context.ApplicationPath, args);

//
// Git Credential Manager's executable used to be named "git-credential-manager-core" before
// dropping the "-core" suffix. In order to prevent "helper not found" errors for users who
// haven't updated their configuration, we include either a 'shim' or symlink with the old name
// that print warning messages about using the old name, and then continue execution of GCM.
//
// On Windows the shim is an exact copy of the main "git-credential-manager.exe" executable
// with the old name. We inspect argv[0] to see which executable we are launched as.
//
// On UNIX systems we do the same check, except instead of a copy we use a symlink.
//
string appPath = context.ApplicationPath;
if (!string.IsNullOrWhiteSpace(appPath))
{
// Trim any (.exe) file extension if we're on Windows
// Note that in some circumstances (like being called by Git when config is set
// to just `helper = manager-core`) we don't always have ".exe" at the end.
if (PlatformUtils.IsWindows() && appPath.EndsWith(".exe", StringComparison.OrdinalIgnoreCase))
{
appPath = appPath.Substring(0, appPath.Length - 4);
}
if (appPath.EndsWith("git-credential-manager-core", StringComparison.OrdinalIgnoreCase))
{
context.Streams.Error.WriteLine(
"warning: git-credential-manager-core was renamed to git-credential-manager");
context.Streams.Error.WriteLine(
$"warning: see {Constants.HelpUrls.GcmExecRename} for more information");
}
}

// Register all supported host providers at the normal priority.
// The generic provider should never win against a more specific one, so register it with low priority.
app.RegisterProvider(new AzureReposHostProvider(context), HostProviderPriority.Normal);
Expand Down
13 changes: 3 additions & 10 deletions src/windows/Installer.Windows/layout.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,17 @@ dotnet publish "$GCM_UI_SRC" `
Write-Output "Publishing Bitbucket UI helper..."
dotnet publish "$BITBUCKET_UI_SRC" `
--configuration "$CONFIGURATION" `
--output "$PAYLOAD"
--output "$PAYLOAD"

Write-Output "Publishing GitHub UI helper..."
dotnet publish "$GITHUB_UI_SRC" `
--configuration "$CONFIGURATION" `
--output "$PAYLOAD"
--output "$PAYLOAD"

Write-Output "Publishing GitLab UI helper..."
dotnet publish "$GITLAB_UI_SRC" `
--configuration "$CONFIGURATION" `
--output "$PAYLOAD"

# Create copy of main GCM executable with older "GCM Core" name
Copy-Item -Path "$PAYLOAD/git-credential-manager.exe" `
-Destination "$PAYLOAD/git-credential-manager-core.exe"

Copy-Item -Path "$PAYLOAD/git-credential-manager.exe.config" `
-Destination "$PAYLOAD/git-credential-manager-core.exe.config"
--output "$PAYLOAD"

# Delete libraries that are not needed for Windows but find their way
# into the publish output.
Expand Down