git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 07/19] Added check to ensure that split succeeds before trying to push

From
Paul Campbell <pcampbell@kemitix.net>
Date
Mar 9, 2013, 19:25 UTC
Message-ID
<CALeLG_mYSzBKv+u=hyHjKi_-ft-3Pyk2aQMyRQ8CbjL2x08rjA@mail.gmail.com>
>From ef4d4081474bd9925b60c2ab856260d9174220b9 Mon Sep 17 00:00:00 2001
From: mhart <michael@adslot.com>
Date: Sun, 16 Oct 2011 00:16:53 +1100
Subject: [PATCH 07/19] Added check to ensure that split succeeds before trying
 to push
---
 contrib/subtree/git-subtree.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 8056851..ae9f87f 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -754,7 +754,12 @@ cmd_push()
         refspec=$(git config -f .gittrees subtree.$prefix.branch)
       fi
 	    echo "git push using: " $repository $refspec
-	    git push $repository $(git subtree split
--prefix=$prefix):refs/heads/$refspec
+	    rev=$(git subtree split --prefix=$prefix)
+	    if [ -n "$rev" ]; then
+	        git push $repository $rev:refs/heads/$refspec
+	    else
+	        die "Couldn't push, 'git subtree split' failed."
+	    fi
 	else
 	    die "'$dir' must already exist. Try 'git subtree add'."
 	fi
-- 
1.8.2.rc1

-- 
Paul [W] Campbell
Message 1 of 1 in “Added check to ensure that split succeeds before trying to push”
  1. 07/19 Added check to ensure that split succeeds before trying to pushPaul Campbell, Mar 9, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.