]> git.phdru.name Git - git-scripts.git/commitdiff
Feat(fork): Check .git in the current directory
authorOleg Broytman <phd@phdru.name>
Wed, 11 Oct 2017 21:47:50 +0000 (00:47 +0300)
committerOleg Broytman <phd@phdru.name>
Wed, 11 Oct 2017 21:47:50 +0000 (00:47 +0300)
fork

diff --git a/fork b/fork
index 2c8d82a780fea20a4d5816b15ac9346425091a2a..2f032d54a6acf572e19f9007321e7fc16a4c331f 100755 (executable)
--- a/fork
+++ b/fork
@@ -10,7 +10,10 @@ origin="$2"
 local_repo="`basename \"$origin\" .git`"
 
 if [ -d "$local_repo"/.git ]; then
-   cd "$local_repo" &&
+   cd "$local_repo"
+fi &&
+
+if [ -d .git ]; then
    git remote add upstream "$upstream" &&
    git remote set-url origin "$origin"
 else