Thread (27 messages) flat view 27 messages, 2 authors, 2016-06-16

Re: [PATCH v2 14/22] i18n: rebase-interactive: mark strings for translation

From: Vasco Almeida <hidden>
Date: 2016-06-16 02:19:37

Às 22:36 de 26-05-2016, Junio C Hamano escreveu:
Vasco Almeida [off-list ref] writes:
quoted
@@ -222,9 +223,10 @@ has_action () {
 }
 
 is_empty_commit() {
-	tree=$(git rev-parse -q --verify "$1"^{tree} 2>/dev/null ||
-		die "$1: not a commit that can be picked")
-	ptree=$(git rev-parse -q --verify "$1"^^{tree} 2>/dev/null ||
+	sha1=$1
+	tree=$(git rev-parse -q --verify "$sha1"^{tree} 2>/dev/null ||
+		die "$(eval_gettext "\$sha1: not a commit that can be picked")")
+	ptree=$(git rev-parse -q --verify "$sha1"^^{tree} 2>/dev/null ||
 		ptree=4b825dc642cb6eb9a060e54bf8d69288fbee4904)
 	test "$tree" = "$ptree"
 }
Both of the two callsites of this function use the variable $sha1,
and at least one of them uses that variable after this function
returns, but they pass it as the first parameter to this function,
so the assignment added by this patch does not break them, which is
good.
I didn't know that. I can change sha1=$1 to local_sha1=$1 or _sha1=$1 (I
don't know what is the convention here) if that is safer, avoiding using
the bash-ism "local" keyword, and preventing future distractions.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help