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

[TopGit PATCH] branch_annihilated: don't use _name as temporary variable

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
Oct 9, 2010, 07:50 UTC
Message-ID
<efdb8c3889e39a36efc328acb1a5e5f55c24be5a.1286610589.git.bert.wesarg@googlemail.com>

_name is used in recurse_deps as an external global. Be on the safe side and don't use a local variable in branch_annihilated.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 tg.sh |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/tg.sh b/tg.sh
index 3718702..b3c5004 100644 tg.sh
--- a/tg.sh
+++ b/tg.sh
@@ -120,12 +120,10 @@ has_remote()
 
 branch_annihilated()
 {
-	_name="$1";
-
 	# use the merge base in case the base is ahead.
-	mb="$(git merge-base "refs/top-bases/$_name" "$_name")";
+	mb="$(git merge-base "refs/top-bases/$1" "$1")";
 
-	test "$(git rev-parse "$mb^{tree}")" = "$(git rev-parse "$_name^{tree}")";
+	test "$(git rev-parse "$mb^{tree}")" = "$(git rev-parse "$1^{tree}")";
 }
 
 # is_sha1 REF
-- 
1.7.1.1067.g5aeb7
Message 1 of 1 in “branch_annihilated: don't use _name as temporary variable”
  1. branch_annihilated: don't use _name as temporary variableBert Wesarg, Oct 9, 2010

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.