aboutsummaryrefslogtreecommitdiffhomepage
path: root/hyprpm/src/core/PluginManager.cpp
diff options
context:
space:
mode:
authorMihai Fufezan <[email protected]>2024-05-12 02:53:50 +0300
committerMihai Fufezan <[email protected]>2024-05-12 17:49:50 +0300
commit2ccd45a84475fab46c6fecd2fe226d3173104743 (patch)
tree312d59a9607c6634dd222feaefcd50d2e9286cc5 /hyprpm/src/core/PluginManager.cpp
parentff93820bbb9313e004e23afb1257aa774a922be1 (diff)
downloadHyprland-2ccd45a84475fab46c6fecd2fe226d3173104743.tar.gz
Hyprland-2ccd45a84475fab46c6fecd2fe226d3173104743.zip
hyprpm: don't shallow clone on non-main branches
Diffstat (limited to 'hyprpm/src/core/PluginManager.cpp')
-rw-r--r--hyprpm/src/core/PluginManager.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/hyprpm/src/core/PluginManager.cpp b/hyprpm/src/core/PluginManager.cpp
index affc7eea..dc3bc548 100644
--- a/hyprpm/src/core/PluginManager.cpp
+++ b/hyprpm/src/core/PluginManager.cpp
@@ -442,15 +442,18 @@ bool CPluginManager::updateHeaders(bool force) {
progress.printMessageAbove(std::string{Colors::YELLOW} + "!" + Colors::RESET + " Cloning https://github.com/hyprwm/hyprland, this might take a moment.");
+ const bool bShallow = HLVER.branch == "main" || HLVER.branch == "";
+
// let us give a bit of leg-room for shallowing
// due to timezones, etc.
const std::string SHALLOW_DATE =
removeBeginEndSpacesTabs(HLVER.date).empty() ? "" : execAndGet("LC_TIME=\"en_US.UTF-8\" date --date='" + HLVER.date + " - 1 weeks' '+\%a \%b \%d \%H:\%M:\%S \%Y'");
- if (m_bVerbose)
+ if (m_bVerbose && bShallow)
progress.printMessageAbove(std::string{Colors::BLUE} + "[v] " + Colors::RESET + "will shallow since: " + SHALLOW_DATE);
- std::string ret = execAndGet("cd /tmp/hyprpm && git clone --recursive https://github.com/hyprwm/hyprland hyprland-" + USERNAME + " --shallow-since='" + SHALLOW_DATE + "'");
+ std::string ret =
+ execAndGet("cd /tmp/hyprpm && git clone --recursive https://github.com/hyprwm/hyprland hyprland-" + USERNAME + (bShallow ? " --shallow-since='" + SHALLOW_DATE + "'" : ""));
if (!std::filesystem::exists(WORKINGDIR)) {
progress.printMessageAbove(std::string{Colors::RED} + "✖" + Colors::RESET + " Clone failed. Retrying without shallow.");