فهرست منبع

Add new remotes to top

Willy-JL 1 سال پیش
والد
کامیت
153b17d30d
3فایلهای تغییر یافته به همراه6 افزوده شده و 3 حذف شده
  1. 4 1
      .utils/add-subtree.sh
  2. 1 1
      pc_monitor/.gitsubtree
  3. 1 1
      t5577_raw_writer/.gitsubtree

+ 4 - 1
.utils/add-subtree.sh

@@ -29,6 +29,7 @@ prevremotedir=""
 if [ -e "${gitsubtree}" ]; then
     echo "Subtree already exists, adding new remote to it."
     prevremotedir="$(mktemp -d /tmp/gitsubtree-XXXXXXXX)"
+    # To use 2 remotes for subtree we need to remove current one, add new one, then merge
     mv -T "${path}" "${prevremotedir}"
     git add "${path}"
     git commit -m "Add new remote for ${path}"
@@ -46,7 +47,9 @@ if [ "${prevremotedir}" != "" ]; then
     mv -T "${prevremotedir}" "${path}"
 fi
 
-echo "${repo} ${branch} ${subdir}" >> "${gitsubtree}"
+# Add new remote at the top
+echo "${repo} ${branch} ${subdir}" | cat - "${gitsubtree}" 2> /dev/null > "${gitsubtree}.new"
+mv "${gitsubtree}.new" "${gitsubtree}"
 git add "${gitsubtree}"
 git commit --amend --no-edit
 

+ 1 - 1
pc_monitor/.gitsubtree

@@ -1,2 +1,2 @@
-https://github.com/TheSainEyereg/flipper-pc-monitor master /
 https://github.com/xMasterX/all-the-plugins dev non_catalog_apps/pc_monitor
+https://github.com/TheSainEyereg/flipper-pc-monitor master /

+ 1 - 1
t5577_raw_writer/.gitsubtree

@@ -1,2 +1,2 @@
-https://github.com/zinongli/T5577_Raw_Writer main /
 https://github.com/xMasterX/all-the-plugins dev non_catalog_apps/t5577_raw_writer
+https://github.com/zinongli/T5577_Raw_Writer main /