shithub: git9

Download patch

ref: 7c271bdf8a13cc1645f16448e47f16c5720cdf17
parent: 3e8d256c825675adb4ec5ce5d829fb0bc18166aa
author: Ori Bernstein <[email protected]>
date: Sun Jan 31 15:46:37 EST 2021

git/pull: fix pulling from arbitrary upstream urls

We used to complain about missing a remote; now,
pull into a 'THEM' remote if we get an arbitrary
url.

--- a/pull
+++ b/pull
@@ -42,9 +42,11 @@
 
 if(~ $#upstream 0)
 	upstream=origin
-remote=`{git/conf 'remote "'$upstream'".url'}
-if(~ $#remote 0)
-	die 'no remote to pull from'
+remote=`$nl{git/conf 'remote "'$upstream'".url'}
+if(~ $#remote 0){
+	remote=$upstream
+	upstream=THEM
+}
 
 update $branch $upstream $remote
 if (~ $fetchonly 1)