git-2.47.0-1.fc42

List of Findings

Error: SHELLCHECK_WARNING (CWE-569): [#def1]
/usr/bin/gitk:12:21: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it.
#   10|   package require Tk
#   11|   
#   12|-> proc hasworktree {} {
#   13|       return [expr {[exec git rev-parse --is-bare-repository] == "false" &&
#   14|                     [exec git rev-parse --is-inside-git-dir] == "false"}]

Error: SHELLCHECK_WARNING (CWE-569): [#def2]
/usr/bin/gitk:13:18: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it.
#   11|   
#   12|   proc hasworktree {} {
#   13|->     return [expr {[exec git rev-parse --is-bare-repository] == "false" &&
#   14|                     [exec git rev-parse --is-inside-git-dir] == "false"}]
#   15|   }

Error: SHELLCHECK_WARNING (CWE-569): [#def3]
/usr/bin/gitk:14:19: error[SC1035]: You need a space after the [ and before the ].
#   12|   proc hasworktree {} {
#   13|       return [expr {[exec git rev-parse --is-bare-repository] == "false" &&
#   14|->                   [exec git rev-parse --is-inside-git-dir] == "false"}]
#   15|   }
#   16|   

Error: SHELLCHECK_WARNING (CWE-398): [#def4]
/usr/bin/gitk:14:19: error[SC1073]: Couldn't parse this test expression. Fix to allow more checks.
#   12|   proc hasworktree {} {
#   13|       return [expr {[exec git rev-parse --is-bare-repository] == "false" &&
#   14|->                   [exec git rev-parse --is-inside-git-dir] == "false"}]
#   15|   }
#   16|   

Error: SHELLCHECK_WARNING: [#def5]
/usr/bin/gitk:14:20: warning[SC1014]: Use 'if cmd; then ..' to check exit code, or 'if [[ $(cmd) == .. ]]' to check output.
#   12|   proc hasworktree {} {
#   13|       return [expr {[exec git rev-parse --is-bare-repository] == "false" &&
#   14|->                   [exec git rev-parse --is-inside-git-dir] == "false"}]
#   15|   }
#   16|   

Error: SHELLCHECK_WARNING (CWE-398): [#def6]
/usr/bin/gitk:14:25: error[SC1072]: Expected test to end here (don't wrap commands in []/[[]]). Fix any mentioned problems and try again.
#   12|   proc hasworktree {} {
#   13|       return [expr {[exec git rev-parse --is-bare-repository] == "false" &&
#   14|->                   [exec git rev-parse --is-inside-git-dir] == "false"}]
#   15|   }
#   16|   

Error: SHELLCHECK_WARNING (CWE-563): [#def7]
/usr/libexec/git-core/git-difftool--helper:8:1: warning[SC2034]: TOOL_MODE appears unused. Verify use (or export if used externally).
#    6|   # Copyright (c) 2009, 2010 David Aguilar
#    7|   
#    8|-> TOOL_MODE=diff
#    9|   . git-mergetool--lib
#   10|   

Error: SHELLCHECK_WARNING (CWE-456): [#def8]
/usr/libexec/git-core/git-difftool--helper:8:1: warning[SC2209]: Use var=$(command) to assign output (or quote to assign string).
#    6|   # Copyright (c) 2009, 2010 David Aguilar
#    7|   
#    8|-> TOOL_MODE=diff
#    9|   . git-mergetool--lib
#   10|   

Error: SHELLCHECK_WARNING (CWE-563): [#def9]
/usr/libexec/git-core/git-difftool--helper:88:2: warning[SC2034]: LOCAL appears unused. Verify use (or export if used externally).
#   86|   if test -n "$GIT_DIFFTOOL_DIRDIFF"
#   87|   then
#   88|-> 	LOCAL="$1"
#   89|   	REMOTE="$2"
#   90|   	initialize_merge_tool "$merge_tool"

Error: SHELLCHECK_WARNING (CWE-563): [#def10]
/usr/libexec/git-core/git-difftool--helper:89:2: warning[SC2034]: REMOTE appears unused. Verify use (or export if used externally).
#   87|   then
#   88|   	LOCAL="$1"
#   89|-> 	REMOTE="$2"
#   90|   	initialize_merge_tool "$merge_tool"
#   91|   	# ignore the error from the above --- run_merge_tool

Error: SHELLCHECK_WARNING (CWE-563): [#def11]
/usr/libexec/git-core/git-filter-branch:100:1: warning[SC2034]: USAGE appears unused. Verify use (or export if used externally).
#   98|   fi
#   99|   
#  100|-> USAGE="[--setup <command>] [--subdirectory-filter <directory>] [--env-filter <command>]
#  101|   	[--tree-filter <command>] [--index-filter <command>]
#  102|   	[--parent-filter <command>] [--msg-filter <command>]

Error: SHELLCHECK_WARNING (CWE-563): [#def12]
/usr/libexec/git-core/git-filter-branch:108:1: warning[SC2034]: OPTIONS_SPEC appears unused. Verify use (or export if used externally).
#  106|   	[--] [<rev-list options>...]"
#  107|   
#  108|-> OPTIONS_SPEC=
#  109|   . git-sh-setup
#  110|   

Error: SHELLCHECK_WARNING (CWE-456): [#def13]
/usr/libexec/git-core/git-filter-branch:121:1: warning[SC2209]: Use var=$(command) to assign output (or quote to assign string).
#  119|   filter_index=
#  120|   filter_parent=
#  121|-> filter_msg=cat
#  122|   filter_commit=
#  123|   filter_tag_name=

Error: SHELLCHECK_WARNING (CWE-480): [#def14]
/usr/libexec/git-core/git-filter-branch:365:10: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
#  363|   git_filter_branch__commit_count=0
#  364|   
#  365|-> progress= start_timestamp=
#  366|   if date '+%s' 2>/dev/null | grep -q '^[0-9][0-9]*$'
#  367|   then

Error: SHELLCHECK_WARNING (CWE-156): [#def15]
/usr/libexec/git-core/git-filter-branch:495:28: warning[SC2046]: Quote this to prevent word splitting.
#  493|   		test -f "$workdir"/../map/$sha1 && continue
#  494|   		ancestor=$(git rev-list --simplify-merges -1 "$ref" "$@")
#  495|-> 		test "$ancestor" && echo $(map $ancestor) >"$workdir"/../map/$sha1
#  496|   	done < "$tempdir"/heads
#  497|   fi

Error: SHELLCHECK_WARNING (CWE-156): [#def16]
/usr/libexec/git-core/git-filter-branch:524:12: warning[SC2046]: Quote this to prevent word splitting.
#  522|   		if ! git update-ref -m "filter-branch: rewrite" \
#  523|   					"$ref" $rewritten $sha1 2>/dev/null; then
#  524|-> 			if test $(git cat-file -t "$ref") = tag; then
#  525|   				if test -z "$filter_tag_name"; then
#  526|   					warn "WARNING: You said to rewrite tagged commits, but not the corresponding tag."

Error: SHELLCHECK_WARNING (CWE-477): [#def17]
/usr/libexec/git-core/git-filter-branch:548:28: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#  546|   		ref="${ref#refs/tags/}"
#  547|   		# XXX: Rewrite tagged trees as well?
#  548|-> 		if [ "$type" != "commit" -a "$type" != "tag" ]; then
#  549|   			continue;
#  550|   		fi

Error: SHELLCHECK_WARNING (CWE-569): [#def18]
/usr/libexec/git-core/git-filter-branch:555:37: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it.
#  553|   			# Dereference to a commit
#  554|   			sha1t="$sha1"
#  555|-> 			sha1="$(git rev-parse -q "$sha1"^{commit})" || continue
#  556|   		fi
#  557|   

Error: SHELLCHECK_WARNING (CWE-569): [#def19]
/usr/libexec/git-core/git-filter-branch:555:44: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it.
#  553|   			# Dereference to a commit
#  554|   			sha1t="$sha1"
#  555|-> 			sha1="$(git rev-parse -q "$sha1"^{commit})" || continue
#  556|   		fi
#  557|   

Error: SHELLCHECK_WARNING (CWE-252): [#def20]
/usr/libexec/git-core/git-filter-branch:655:1: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
#  653|   fi
#  654|   
#  655|-> cd "$orig_dir"
#  656|   rm -rf "$tempdir"
#  657|   

Error: SHELLCHECK_WARNING (CWE-561): [#def21]
/usr/libexec/git-core/git-gui:10:2: warning[SC2093]: Remove "exec " if script should continue after this command.
#    8|    fi; \
#    9|    argv0=$0; \
#   10|->  exec 'wish' "$argv0" -- "$@"
#   11|   
#   12|   set appvers {0.21.0.128.g2864e}

Error: SHELLCHECK_WARNING (CWE-456): [#def22]
/usr/libexec/git-core/git-gui:12:5: warning[SC2121]: To assign a variable, use just 'var=value', no 'set ..'.
#   10|    exec 'wish' "$argv0" -- "$@"
#   11|   
#   12|-> set appvers {0.21.0.128.g2864e}
#   13|   set copyright [string map [list (c) \u00a9] {
#   14|   Copyright (c) 2006-2010 Shawn Pearce, et. al.

Error: SHELLCHECK_WARNING (CWE-569): [#def23]
/usr/libexec/git-core/git-gui:12:13: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it.
#   10|    exec 'wish' "$argv0" -- "$@"
#   11|   
#   12|-> set appvers {0.21.0.128.g2864e}
#   13|   set copyright [string map [list (c) \u00a9] {
#   14|   Copyright (c) 2006-2010 Shawn Pearce, et. al.

Error: SHELLCHECK_WARNING (CWE-569): [#def24]
/usr/libexec/git-core/git-gui:12:31: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it.
#   10|    exec 'wish' "$argv0" -- "$@"
#   11|   
#   12|-> set appvers {0.21.0.128.g2864e}
#   13|   set copyright [string map [list (c) \u00a9] {
#   14|   Copyright (c) 2006-2010 Shawn Pearce, et. al.

Error: SHELLCHECK_WARNING (CWE-456): [#def25]
/usr/libexec/git-core/git-gui:13:5: warning[SC2121]: To assign a variable, use just 'var=value', no 'set ..'.
#   11|   
#   12|   set appvers {0.21.0.128.g2864e}
#   13|-> set copyright [string map [list (c) \u00a9] {
#   14|   Copyright (c) 2006-2010 Shawn Pearce, et. al.
#   15|   

Error: SHELLCHECK_WARNING (CWE-398): [#def26]
/usr/libexec/git-core/git-gui:13:33: error[SC1036]: '(' is invalid here. Did you forget to escape it?
#   11|   
#   12|   set appvers {0.21.0.128.g2864e}
#   13|-> set copyright [string map [list (c) \u00a9] {
#   14|   Copyright (c) 2006-2010 Shawn Pearce, et. al.
#   15|   

Error: SHELLCHECK_WARNING (CWE-398): [#def27]
/usr/libexec/git-core/git-gui:13:33: error[SC1088]: Parsing stopped here. Invalid use of parentheses?
#   11|   
#   12|   set appvers {0.21.0.128.g2864e}
#   13|-> set copyright [string map [list (c) \u00a9] {
#   14|   Copyright (c) 2006-2010 Shawn Pearce, et. al.
#   15|   

Error: SHELLCHECK_WARNING: [#def28]
/usr/libexec/git-core/git-gui--askpass:14:1: error[SC1049]: Did you forget the 'then' for this 'if'?
#   12|   set rc     255
#   13|   
#   14|-> if {$argc < 1} {
#   15|   	set prompt "Enter your OpenSSH passphrase:"
#   16|   } else {

Error: SHELLCHECK_WARNING (CWE-398): [#def29]
/usr/libexec/git-core/git-gui--askpass:14:1: error[SC1073]: Couldn't parse this if expression. Fix to allow more checks.
#   12|   set rc     255
#   13|   
#   14|-> if {$argc < 1} {
#   15|   	set prompt "Enter your OpenSSH passphrase:"
#   16|   } else {

Error: SHELLCHECK_WARNING: [#def30]
/usr/libexec/git-core/git-gui--askpass:14:5: error[SC1054]: You need a space after the '{'.
#   12|   set rc     255
#   13|   
#   14|-> if {$argc < 1} {
#   15|   	set prompt "Enter your OpenSSH passphrase:"
#   16|   } else {

Error: SHELLCHECK_WARNING (CWE-569): [#def31]
/usr/libexec/git-core/git-gui--askpass:14:14: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it.
#   12|   set rc     255
#   13|   
#   14|-> if {$argc < 1} {
#   15|   	set prompt "Enter your OpenSSH passphrase:"
#   16|   } else {

Error: SHELLCHECK_WARNING (CWE-569): [#def32]
/usr/libexec/git-core/git-gui--askpass:14:16: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it.
#   12|   set rc     255
#   13|   
#   14|-> if {$argc < 1} {
#   15|   	set prompt "Enter your OpenSSH passphrase:"
#   16|   } else {

Error: SHELLCHECK_WARNING: [#def33]
/usr/libexec/git-core/git-gui--askpass:16:3: error[SC1050]: Expected 'then'.
#   14|   if {$argc < 1} {
#   15|   	set prompt "Enter your OpenSSH passphrase:"
#   16|-> } else {
#   17|   	set prompt [join $argv " "]
#   18|   	if {[regexp -nocase {\(yes\/no\)\?\s*$} $prompt]} {

Error: SHELLCHECK_WARNING (CWE-398): [#def34]
/usr/libexec/git-core/git-gui--askpass:16:8: error[SC1072]: Unexpected . Fix any mentioned problems and try again.
#   14|   if {$argc < 1} {
#   15|   	set prompt "Enter your OpenSSH passphrase:"
#   16|-> } else {
#   17|   	set prompt [join $argv " "]
#   18|   	if {[regexp -nocase {\(yes\/no\)\?\s*$} $prompt]} {

Error: SHELLCHECK_WARNING (CWE-563): [#def35]
/usr/libexec/git-core/git-instaweb:7:1: warning[SC2034]: OPTIONS_KEEPDASHDASH appears unused. Verify use (or export if used externally).
#    5|   
#    6|   PERL='/usr/bin/perl'
#    7|-> OPTIONS_KEEPDASHDASH=
#    8|   OPTIONS_STUCKLONG=
#    9|   OPTIONS_SPEC="\

Error: SHELLCHECK_WARNING (CWE-563): [#def36]
/usr/libexec/git-core/git-instaweb:8:1: warning[SC2034]: OPTIONS_STUCKLONG appears unused. Verify use (or export if used externally).
#    6|   PERL='/usr/bin/perl'
#    7|   OPTIONS_KEEPDASHDASH=
#    8|-> OPTIONS_STUCKLONG=
#    9|   OPTIONS_SPEC="\
#   10|   git instaweb [options] (--start | --stop | --restart)

Error: SHELLCHECK_WARNING (CWE-563): [#def37]
/usr/libexec/git-core/git-instaweb:9:1: warning[SC2034]: OPTIONS_SPEC appears unused. Verify use (or export if used externally).
#    7|   OPTIONS_KEEPDASHDASH=
#    8|   OPTIONS_STUCKLONG=
#    9|-> OPTIONS_SPEC="\
#   10|   git instaweb [options] (--start | --stop | --restart)
#   11|   --

Error: SHELLCHECK_WARNING (CWE-563): [#def38]
/usr/libexec/git-core/git-instaweb:23:1: warning[SC2034]: SUBDIRECTORY_OK appears unused. Verify use (or export if used externally).
#   21|   "
#   22|   
#   23|-> SUBDIRECTORY_OK=Yes
#   24|   . git-sh-setup
#   25|   

Error: SHELLCHECK_WARNING (CWE-156): [#def39]
/usr/libexec/git-core/git-instaweb:146:34: warning[SC2046]: Quote this to prevent word splitting.
#  144|   
#  145|   stop_httpd () {
#  146|-> 	test -f "$fqgitdir/pid" && kill $(cat "$fqgitdir/pid")
#  147|   	rm -f "$fqgitdir/pid"
#  148|   }

Error: SHELLCHECK_WARNING (CWE-457): [#def40]
/usr/libexec/git-core/git-instaweb:562:27: warning[SC2154]: fd is referenced but not assigned.
#  560|   	};
#  561|   	# gitweb currently doesn't work with $SIG{CHLD} set to 'IGNORE',
#  562|-> 	# because it uses 'close $fd or die...' on piped filehandle $fh
#  563|   	# (which causes the parent process to wait for child to finish).
#  564|   	enable_if { \$SIG{'CHLD'} eq 'IGNORE' } sub {

Error: SHELLCHECK_WARNING (CWE-457): [#def41]
/usr/libexec/git-core/git-instaweb:562:62: warning[SC2154]: fh is referenced but not assigned.
#  560|   	};
#  561|   	# gitweb currently doesn't work with $SIG{CHLD} set to 'IGNORE',
#  562|-> 	# because it uses 'close $fd or die...' on piped filehandle $fh
#  563|   	# (which causes the parent process to wait for child to finish).
#  564|   	enable_if { \$SIG{'CHLD'} eq 'IGNORE' } sub {

Error: SHELLCHECK_WARNING (CWE-480): [#def42]
/usr/libexec/git-core/git-merge-octopus:14:7: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
#   12|   
#   13|   # The first parameters up to -- are merge bases; the rest are heads.
#   14|-> bases= head= remotes= sep_seen=
#   15|   for arg
#   16|   do

Error: SHELLCHECK_WARNING (CWE-480): [#def43]
/usr/libexec/git-core/git-merge-octopus:14:13: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
#   12|   
#   13|   # The first parameters up to -- are merge bases; the rest are heads.
#   14|-> bases= head= remotes= sep_seen=
#   15|   for arg
#   16|   do

Error: SHELLCHECK_WARNING (CWE-480): [#def44]
/usr/libexec/git-core/git-merge-octopus:14:22: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
#   12|   
#   13|   # The first parameters up to -- are merge bases; the rest are heads.
#   14|-> bases= head= remotes= sep_seen=
#   15|   for arg
#   16|   do

Error: SHELLCHECK_WARNING (CWE-569): [#def45]
/usr/libexec/git-core/git-merge-octopus:66:21: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it.
#   64|   	esac
#   65|   
#   66|-> 	eval pretty_name=\${GITHEAD_$SHA1:-$SHA1}
#   67|   	if test "$SHA1" = "$pretty_name"
#   68|   	then

Error: SHELLCHECK_WARNING (CWE-569): [#def46]
/usr/libexec/git-core/git-merge-octopus:66:42: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it.
#   64|   	esac
#   65|   
#   66|-> 	eval pretty_name=\${GITHEAD_$SHA1:-$SHA1}
#   67|   	if test "$SHA1" = "$pretty_name"
#   68|   	then

Error: SHELLCHECK_WARNING (CWE-457): [#def47]
/usr/libexec/git-core/git-merge-octopus:67:21: warning[SC2154]: pretty_name is referenced but not assigned.
#   65|   
#   66|   	eval pretty_name=\${GITHEAD_$SHA1:-$SHA1}
#   67|-> 	if test "$SHA1" = "$pretty_name"
#   68|   	then
#   69|   		SHA1_UP="$(echo "$SHA1" | tr a-z A-Z)"

Error: SHELLCHECK_WARNING (CWE-569): [#def48]
/usr/libexec/git-core/git-merge-octopus:70:22: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it.
#   68|   	then
#   69|   		SHA1_UP="$(echo "$SHA1" | tr a-z A-Z)"
#   70|-> 		eval pretty_name=\${GITHEAD_$SHA1_UP:-$pretty_name}
#   71|   	fi
#   72|   	common=$(git merge-base --all $SHA1 $MRC) ||

Error: SHELLCHECK_WARNING (CWE-569): [#def49]
/usr/libexec/git-core/git-merge-octopus:70:53: warning[SC1083]: This } is literal. Check expression (missing ;/\n?) or quote it.
#   68|   	then
#   69|   		SHA1_UP="$(echo "$SHA1" | tr a-z A-Z)"
#   70|-> 		eval pretty_name=\${GITHEAD_$SHA1_UP:-$pretty_name}
#   71|   	fi
#   72|   	common=$(git merge-base --all $SHA1 $MRC) ||

Error: SHELLCHECK_WARNING (CWE-563): [#def50]
/usr/libexec/git-core/git-merge-one-file:25:1: warning[SC2034]: SUBDIRECTORY_OK appears unused. Verify use (or export if used externally).
#   23|   Blob ids and modes should be empty for missing files."
#   24|   
#   25|-> SUBDIRECTORY_OK=Yes
#   26|   . git-sh-setup
#   27|   cd_to_toplevel

Error: SHELLCHECK_WARNING (CWE-156): [#def51]
/usr/libexec/git-core/git-merge-one-file:123:26: warning[SC2046]: Quote this to prevent word splitting.
#  121|   	'')
#  122|   		echo "Added $4 in both, but differently."
#  123|-> 		orig=$(git unpack-file $(git hash-object /dev/null))
#  124|   		;;
#  125|   	*)

Error: SHELLCHECK_WARNING (CWE-480): [#def52]
/usr/libexec/git-core/git-merge-resolve:19:7: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
#   17|   
#   18|   # The first parameters up to -- are merge bases; the rest are heads.
#   19|-> bases= head= remotes= sep_seen=
#   20|   for arg
#   21|   do

Error: SHELLCHECK_WARNING (CWE-480): [#def53]
/usr/libexec/git-core/git-merge-resolve:19:13: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
#   17|   
#   18|   # The first parameters up to -- are merge bases; the rest are heads.
#   19|-> bases= head= remotes= sep_seen=
#   20|   for arg
#   21|   do

Error: SHELLCHECK_WARNING (CWE-480): [#def54]
/usr/libexec/git-core/git-merge-resolve:19:22: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
#   17|   
#   18|   # The first parameters up to -- are merge bases; the rest are heads.
#   19|-> bases= head= remotes= sep_seen=
#   20|   for arg
#   21|   do

Error: SHELLCHECK_WARNING (CWE-563): [#def55]
/usr/libexec/git-core/git-merge-resolve:53:4: warning[SC2034]: result_tree appears unused. Verify use (or export if used externally).
#   51|   git read-tree -u -m --aggressive $bases $head $remotes || exit 2
#   52|   echo "Trying simple merge."
#   53|-> if result_tree=$(git write-tree 2>/dev/null)
#   54|   then
#   55|   	exit 0

Error: SHELLCHECK_WARNING (CWE-563): [#def56]
/usr/libexec/git-core/git-mergetool:12:1: warning[SC2034]: USAGE appears unused. Verify use (or export if used externally).
#   10|   #
#   11|   
#   12|-> USAGE='[--tool=tool] [--tool-help] [-y|--no-prompt|--prompt] [-g|--gui|--no-gui] [-O<orderfile>] [file to merge] ...'
#   13|   SUBDIRECTORY_OK=Yes
#   14|   NONGIT_OK=Yes

Error: SHELLCHECK_WARNING (CWE-563): [#def57]
/usr/libexec/git-core/git-mergetool:13:1: warning[SC2034]: SUBDIRECTORY_OK appears unused. Verify use (or export if used externally).
#   11|   
#   12|   USAGE='[--tool=tool] [--tool-help] [-y|--no-prompt|--prompt] [-g|--gui|--no-gui] [-O<orderfile>] [file to merge] ...'
#   13|-> SUBDIRECTORY_OK=Yes
#   14|   NONGIT_OK=Yes
#   15|   OPTIONS_SPEC=

Error: SHELLCHECK_WARNING (CWE-563): [#def58]
/usr/libexec/git-core/git-mergetool:14:1: warning[SC2034]: NONGIT_OK appears unused. Verify use (or export if used externally).
#   12|   USAGE='[--tool=tool] [--tool-help] [-y|--no-prompt|--prompt] [-g|--gui|--no-gui] [-O<orderfile>] [file to merge] ...'
#   13|   SUBDIRECTORY_OK=Yes
#   14|-> NONGIT_OK=Yes
#   15|   OPTIONS_SPEC=
#   16|   TOOL_MODE=merge

Error: SHELLCHECK_WARNING (CWE-563): [#def59]
/usr/libexec/git-core/git-mergetool:15:1: warning[SC2034]: OPTIONS_SPEC appears unused. Verify use (or export if used externally).
#   13|   SUBDIRECTORY_OK=Yes
#   14|   NONGIT_OK=Yes
#   15|-> OPTIONS_SPEC=
#   16|   TOOL_MODE=merge
#   17|   . git-sh-setup

Error: SHELLCHECK_WARNING (CWE-569): [#def60]
/usr/libexec/git-core/git-mergetool:238:3: warning[SC2188]: This redirection doesn't have a command. Move to its command (or use 'true' as no-op).
#  236|   		mv -- "$(git rev-parse --show-cdup)$tmpfile" "$3"
#  237|   	else
#  238|-> 		>"$3"
#  239|   	fi
#  240|   }

Error: SHELLCHECK_WARNING (CWE-480): [#def61]
/usr/libexec/git-core/git-mergetool:293:12: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
#  291|   	BASE="$MERGETOOL_TMPDIR/${BASE}_BASE_$$$ext"
#  292|   
#  293|-> 	base_mode= local_mode= remote_mode=
#  294|   
#  295|   	# here, $IFS is just a LF

Error: SHELLCHECK_WARNING (CWE-480): [#def62]
/usr/libexec/git-core/git-mergetool:293:24: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
#  291|   	BASE="$MERGETOOL_TMPDIR/${BASE}_BASE_$$$ext"
#  292|   
#  293|-> 	base_mode= local_mode= remote_mode=
#  294|   
#  295|   	# here, $IFS is just a LF

Error: SHELLCHECK_WARNING (CWE-563): [#def63]
/usr/libexec/git-core/git-mergetool:462:4: warning[SC2034]: TOOL_MODE appears unused. Verify use (or export if used externally).
#  460|   		case "$1" in
#  461|   		--tool-help=*)
#  462|-> 			TOOL_MODE=${1#--tool-help=}
#  463|   			show_tool_help
#  464|   			;;

Error: SHELLCHECK_WARNING (CWE-563): [#def64]
/usr/libexec/git-core/git-mergetool:484:4: warning[SC2034]: GIT_MERGETOOL_GUI appears unused. Verify use (or export if used externally).
#  482|   			;;
#  483|   		-g|--gui)
#  484|-> 			GIT_MERGETOOL_GUI=true
#  485|   			;;
#  486|   		-y|--no-prompt)

Error: SHELLCHECK_WARNING (CWE-156): [#def65]
/usr/libexec/git-core/git-mergetool:540:10: warning[SC2046]: Quote this to prevent word splitting.
#  538|   	if test $# -eq 0 && test -e "$GIT_DIR/MERGE_RR"
#  539|   	then
#  540|-> 		set -- $(git rerere remaining)
#  541|   		if test $# -eq 0
#  542|   		then

Error: SHELLCHECK_WARNING (CWE-563): [#def66]
/usr/libexec/git-core/git-quiltimport:2:1: warning[SC2034]: OPTIONS_KEEPDASHDASH appears unused. Verify use (or export if used externally).
#    1|   #!/usr/bin/sh
#    2|-> OPTIONS_KEEPDASHDASH=
#    3|   OPTIONS_STUCKLONG=
#    4|   OPTIONS_SPEC="\

Error: SHELLCHECK_WARNING (CWE-563): [#def67]
/usr/libexec/git-core/git-quiltimport:3:1: warning[SC2034]: OPTIONS_STUCKLONG appears unused. Verify use (or export if used externally).
#    1|   #!/usr/bin/sh
#    2|   OPTIONS_KEEPDASHDASH=
#    3|-> OPTIONS_STUCKLONG=
#    4|   OPTIONS_SPEC="\
#    5|   git quiltimport [options]

Error: SHELLCHECK_WARNING (CWE-563): [#def68]
/usr/libexec/git-core/git-quiltimport:4:1: warning[SC2034]: OPTIONS_SPEC appears unused. Verify use (or export if used externally).
#    2|   OPTIONS_KEEPDASHDASH=
#    3|   OPTIONS_STUCKLONG=
#    4|-> OPTIONS_SPEC="\
#    5|   git quiltimport [options]
#    6|   --

Error: SHELLCHECK_WARNING (CWE-563): [#def69]
/usr/libexec/git-core/git-quiltimport:13:1: warning[SC2034]: SUBDIRECTORY_ON appears unused. Verify use (or export if used externally).
#   11|   keep-non-patch Pass -b to git mailinfo
#   12|   "
#   13|-> SUBDIRECTORY_ON=Yes
#   14|   . git-sh-setup
#   15|   

Error: SHELLCHECK_WARNING (CWE-563): [#def70]
/usr/libexec/git-core/git-request-pull:7:1: warning[SC2034]: SUBDIRECTORY_OK appears unused. Verify use (or export if used externally).
#    5|   # at the discretion of Linus Torvalds.
#    6|   
#    7|-> SUBDIRECTORY_OK='Yes'
#    8|   OPTIONS_KEEPDASHDASH=
#    9|   OPTIONS_STUCKLONG=

Error: SHELLCHECK_WARNING (CWE-563): [#def71]
/usr/libexec/git-core/git-request-pull:8:1: warning[SC2034]: OPTIONS_KEEPDASHDASH appears unused. Verify use (or export if used externally).
#    6|   
#    7|   SUBDIRECTORY_OK='Yes'
#    8|-> OPTIONS_KEEPDASHDASH=
#    9|   OPTIONS_STUCKLONG=
#   10|   OPTIONS_SPEC='git request-pull [options] start url [end]

Error: SHELLCHECK_WARNING (CWE-563): [#def72]
/usr/libexec/git-core/git-request-pull:9:1: warning[SC2034]: OPTIONS_STUCKLONG appears unused. Verify use (or export if used externally).
#    7|   SUBDIRECTORY_OK='Yes'
#    8|   OPTIONS_KEEPDASHDASH=
#    9|-> OPTIONS_STUCKLONG=
#   10|   OPTIONS_SPEC='git request-pull [options] start url [end]
#   11|   --

Error: SHELLCHECK_WARNING (CWE-563): [#def73]
/usr/libexec/git-core/git-request-pull:10:1: warning[SC2034]: OPTIONS_SPEC appears unused. Verify use (or export if used externally).
#    8|   OPTIONS_KEEPDASHDASH=
#    9|   OPTIONS_STUCKLONG=
#   10|-> OPTIONS_SPEC='git request-pull [options] start url [end]
#   11|   --
#   12|   p    show patch text as well

Error: SHELLCHECK_WARNING (CWE-457): [#def74]
/usr/libexec/git-core/git-request-pull:72:29: warning[SC2154]: headref is referenced but not assigned (did you mean 'headrev'?).
#   70|   # Was it a branch with a description?
#   71|   branch_name=${head#refs/heads/}
#   72|-> if test "z$branch_name" = "z$headref" ||
#   73|   	! git config "branch.$branch_name.description" >/dev/null
#   74|   then

Error: SHELLCHECK_WARNING (CWE-456): [#def75]
/usr/libexec/git-core/git-request-pull:115:5: warning[SC2121]: To assign a variable, use just 'var=value', no 'set ..'.
#  113|   '
#  114|   
#  115|-> set fnord $(git ls-remote "$url" | /usr/bin/perl -e "$find_matching_ref" "${remote:-HEAD}" "$headrev")
#  116|   remote_sha1=$2
#  117|   ref=$3

Error: SHELLCHECK_WARNING (CWE-156): [#def76]
/usr/libexec/git-core/git-request-pull:115:11: warning[SC2046]: Quote this to prevent word splitting.
#  113|   '
#  114|   
#  115|-> set fnord $(git ls-remote "$url" | /usr/bin/perl -e "$find_matching_ref" "${remote:-HEAD}" "$headrev")
#  116|   remote_sha1=$2
#  117|   ref=$3

Error: SHELLCHECK_WARNING (CWE-156): [#def77]
/usr/libexec/git-core/git-request-pull:153:9: warning[SC2046]: Quote this to prevent word splitting.
#  151|   ----------------------------------------------------------------' $headrev &&
#  152|   
#  153|-> if test $(git cat-file -t "$head") = tag
#  154|   then
#  155|   	git cat-file tag "$head" |

Error: SHELLCHECK_WARNING (CWE-563): [#def78]
/usr/libexec/git-core/git-submodule:8:1: warning[SC2034]: USAGE appears unused. Verify use (or export if used externally).
#    6|   
#    7|   dashless=$(basename "$0" | sed -e 's/-/ /')
#    8|-> USAGE="[--quiet] [--cached]
#    9|      or: $dashless [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]
#   10|      or: $dashless [--quiet] status [--cached] [--recursive] [--] [<path>...]

Error: SHELLCHECK_WARNING (CWE-563): [#def79]
/usr/libexec/git-core/git-submodule:20:1: warning[SC2034]: OPTIONS_SPEC appears unused. Verify use (or export if used externally).
#   18|      or: $dashless [--quiet] sync [--recursive] [--] [<path>...]
#   19|      or: $dashless [--quiet] absorbgitdirs [--] [<path>...]"
#   20|-> OPTIONS_SPEC=
#   21|   SUBDIRECTORY_OK=Yes
#   22|   . git-sh-setup

Error: SHELLCHECK_WARNING (CWE-563): [#def80]
/usr/libexec/git-core/git-submodule:21:1: warning[SC2034]: SUBDIRECTORY_OK appears unused. Verify use (or export if used externally).
#   19|      or: $dashless [--quiet] absorbgitdirs [--] [<path>...]"
#   20|   OPTIONS_SPEC=
#   21|-> SUBDIRECTORY_OK=Yes
#   22|   . git-sh-setup
#   23|   require_work_tree

Error: SHELLCHECK_WARNING (CWE-563): [#def81]
/usr/libexec/git-core/git-submodule:493:2: warning[SC2034]: diff_cmd appears unused. Verify use (or export if used externally).
#  491|   	summary_limit=-1
#  492|   	for_status=
#  493|-> 	diff_cmd=diff-index
#  494|   
#  495|   	# parse $args after "submodule ... summary".

Error: SHELLCHECK_WARNING (CWE-685): [#def82]
/usr/libexec/git-core/git-subtree:281:1: warning[SC2120]: cache_setup references arguments, but none are ever passed.
#  279|   
#  280|   # Usage: cache_setup
#  281|-> cache_setup () {
#  282|   	assert test $# = 0
#  283|   	cachedir="$GIT_DIR/subtree-cache/$$"

Error: SHELLCHECK_WARNING: [#def83]
/usr/libexec/git-core/git-subtree:319:2: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  317|   check_parents () {
#  318|   	missed=$(cache_miss "$@") || exit $?
#  319|-> 	local indent=$(($indent + 1))
#  320|   	for miss in $missed
#  321|   	do

Error: SHELLCHECK_WARNING: [#def84]
/usr/libexec/git-core/git-subtree:415:2: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  413|   	fi
#  414|   	debug "Looking for latest squash (dir=$dir, repository=$repository)..."
#  415|-> 	local indent=$(($indent + 1))
#  416|   
#  417|   	sq=

Error: SHELLCHECK_WARNING: [#def85]
/usr/libexec/git-core/git-subtree:463:2: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  461|   	assert test $# -le 3
#  462|   	debug "Looking for prior splits..."
#  463|-> 	local indent=$(($indent + 1))
#  464|   
#  465|   	dir="$1"

Error: SHELLCHECK_WARNING: [#def86]
/usr/libexec/git-core/git-subtree:474:2: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  472|   	main=
#  473|   	sub=
#  474|-> 	local grep_format="^git-subtree-dir: $dir/*\$"
#  475|   	if test -n "$arg_split_ignore_joins"
#  476|   	then

Error: SHELLCHECK_WARNING (CWE-563): [#def87]
/usr/libexec/git-core/git-subtree:641:13: warning[SC2034]: mode appears unused. Verify use (or export if used externally).
#  639|   	dir="$2"
#  640|   	git ls-tree "$commit" -- "$dir" |
#  641|-> 	while read mode type tree name
#  642|   	do
#  643|   		assert test "$name" = "$dir"

Error: SHELLCHECK_WARNING (CWE-685): [#def88]
/usr/libexec/git-core/git-subtree:771:1: warning[SC2120]: ensure_clean references arguments, but none are ever passed.
#  769|   
#  770|   # Usage: ensure_clean
#  771|-> ensure_clean () {
#  772|   	assert test $# = 0
#  773|   	if ! git diff-index HEAD --exit-code --quiet 2>&1

Error: SHELLCHECK_WARNING: [#def89]
/usr/libexec/git-core/git-subtree:794:2: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  792|   should_ignore_subtree_split_commit () {
#  793|   	assert test $# = 1
#  794|-> 	local rev="$1"
#  795|   	if test -n "$(git log -1 --grep="git-subtree-dir:" $rev)"
#  796|   	then

Error: SHELLCHECK_WARNING: [#def90]
/usr/libexec/git-core/git-subtree:809:2: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  807|   process_split_commit () {
#  808|   	assert test $# = 2
#  809|-> 	local rev="$1"
#  810|   	local parents="$2"
#  811|   

Error: SHELLCHECK_WARNING: [#def91]
/usr/libexec/git-core/git-subtree:810:2: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  808|   	assert test $# = 2
#  809|   	local rev="$1"
#  810|-> 	local parents="$2"
#  811|   
#  812|   	if test $indent -eq 0

Error: SHELLCHECK_WARNING: [#def92]
/usr/libexec/git-core/git-subtree:825:2: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  823|   
#  824|   	debug "Processing commit: $rev"
#  825|-> 	local indent=$(($indent + 1))
#  826|   	exists=$(cache_get "$rev") || exit $?
#  827|   	if test -n "$exists"

Error: SHELLCHECK_WARNING (CWE-563): [#def93]
/usr/libexec/git-core/git-subtree:978:2: warning[SC2034]: unrevs appears unused. Verify use (or export if used externally).
#  976|   	fi
#  977|   
#  978|-> 	unrevs="$(find_existing_splits "$dir" "$rev" "$repository")" || exit $?
#  979|   
#  980|   	# We can't restrict rev-list to only $dir here, because some of our

Error: SHELLCHECK_WARNING (CWE-563): [#def94]
/usr/libexec/git-core/git-web--browse:19:1: warning[SC2034]: USAGE appears unused. Verify use (or export if used externally).
#   17|   #
#   18|   
#   19|-> USAGE='[--browser=browser|--tool=browser] [--config=conf.var] url/file ...'
#   20|   
#   21|   # This must be capable of running outside of git directory, so

Error: SHELLCHECK_WARNING (CWE-563): [#def95]
/usr/libexec/git-core/git-web--browse:23:1: warning[SC2034]: NONGIT_OK appears unused. Verify use (or export if used externally).
#   21|   # This must be capable of running outside of git directory, so
#   22|   # the vanilla git-sh-setup should not be used.
#   23|-> NONGIT_OK=Yes
#   24|   . git-sh-setup
#   25|   

Error: SHELLCHECK_WARNING (CWE-140): [#def96]
/usr/share/doc/git/contrib/completion/git-completion.bash:376:13: warning[SC2206]: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.
#  374|   	local IFS=$'\n'
#  375|   
#  376|-> 	COMPREPLY=($1)
#  377|   }
#  378|   

Error: SHELLCHECK_WARNING (CWE-140): [#def97]
/usr/share/doc/git/contrib/completion/git-completion.bash:389:14: warning[SC2206]: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.
#  387|   	local IFS=$'\n'
#  388|   
#  389|-> 	COMPREPLY+=($1)
#  390|   }
#  391|   

Error: SHELLCHECK_WARNING (CWE-569): [#def98]
/usr/share/doc/git/contrib/completion/git-completion.bash:464:10: error[SC2296]: Parameter expansions can't start with (. Double check syntax.
#  462|   # the completion script.
#  463|   if [[ -n ${ZSH_VERSION-} ]]; then
#  464|-> 	unset ${(M)${(k)parameters[@]}:#__gitcomp_builtin_*} 2>/dev/null
#  465|   else
#  466|   	unset $(compgen -v __gitcomp_builtin_)

Error: SHELLCHECK_WARNING (CWE-569): [#def99]
/usr/share/doc/git/contrib/completion/git-completion.bash:464:15: error[SC2296]: Parameter expansions can't start with (. Double check syntax.
#  462|   # the completion script.
#  463|   if [[ -n ${ZSH_VERSION-} ]]; then
#  464|-> 	unset ${(M)${(k)parameters[@]}:#__gitcomp_builtin_*} 2>/dev/null
#  465|   else
#  466|   	unset $(compgen -v __gitcomp_builtin_)

Error: SHELLCHECK_WARNING (CWE-156): [#def100]
/usr/share/doc/git/contrib/completion/git-completion.bash:466:8: warning[SC2046]: Quote this to prevent word splitting.
#  464|   	unset ${(M)${(k)parameters[@]}:#__gitcomp_builtin_*} 2>/dev/null
#  465|   else
#  466|-> 	unset $(compgen -v __gitcomp_builtin_)
#  467|   fi
#  468|   

Error: SHELLCHECK_WARNING (CWE-140): [#def101]
/usr/share/doc/git/contrib/completion/git-completion.bash:561:13: warning[SC2206]: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.
#  559|   	local IFS=$'\n'
#  560|   
#  561|-> 	COMPREPLY=($1)
#  562|   
#  563|   	# use a hack to enable file mode in bash < 4

Error: SHELLCHECK_WARNING: [#def102]
/usr/share/doc/git/contrib/completion/git-completion.bash:894:9: warning[SC2194]: This word is constant. Did you forget the $ on a variable?
#  892|   	*)
#  893|   		if [ "$list_refs_from" = remote ]; then
#  894|-> 			case "HEAD" in
#  895|   			$match*|$umatch*)	echo "${pfx}HEAD$sfx" ;;
#  896|   			esac

Error: SHELLCHECK_WARNING: [#def103]
/usr/share/doc/git/contrib/completion/git-completion.bash:903:9: warning[SC2194]: This word is constant. Did you forget the $ on a variable?
#  901|   		else
#  902|   			local query_symref
#  903|-> 			case "HEAD" in
#  904|   			$match*|$umatch*)	query_symref="HEAD" ;;
#  905|   			esac

Error: SHELLCHECK_WARNING (CWE-480): [#def104]
/usr/share/doc/git/contrib/completion/git-completion.bash:938:15: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
#  936|   __git_complete_refs ()
#  937|   {
#  938|-> 	local remote= dwim= pfx= cur_="$cur" sfx=" " mode="refs"
#  939|   
#  940|   	while test $# != 0; do

Error: SHELLCHECK_WARNING (CWE-480): [#def105]
/usr/share/doc/git/contrib/completion/git-completion.bash:938:21: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
#  936|   __git_complete_refs ()
#  937|   {
#  938|-> 	local remote= dwim= pfx= cur_="$cur" sfx=" " mode="refs"
#  939|   
#  940|   	while test $# != 0; do

Error: SHELLCHECK_WARNING (CWE-480): [#def106]
/usr/share/doc/git/contrib/completion/git-completion.bash:938:26: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
#  936|   __git_complete_refs ()
#  937|   {
#  938|-> 	local remote= dwim= pfx= cur_="$cur" sfx=" " mode="refs"
#  939|   
#  940|   	while test $# != 0; do

Error: SHELLCHECK_WARNING (CWE-563): [#def107]
/usr/share/doc/git/contrib/completion/git-completion.bash:1006:16: warning[SC2034]: hash appears unused. Verify use (or export if used externally).
# 1004|   	local i hash
# 1005|   	__git ls-remote "$1" 'refs/heads/*' | \
# 1006|-> 	while read -r hash i; do
# 1007|   		echo "$i:refs/remotes/$1/${i#refs/heads/}"
# 1008|   	done

Error: SHELLCHECK_WARNING (CWE-480): [#def108]
/usr/share/doc/git/contrib/completion/git-completion.bash:1246:25: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
# 1244|   __git_aliased_command ()
# 1245|   {
# 1246|-> 	local cur=$1 last list= word cmdline
# 1247|   
# 1248|   	while [[ -n "$cur" ]]; do

Error: SHELLCHECK_WARNING (CWE-569): [#def109]
/usr/share/doc/git/contrib/completion/git-completion.bash:1270:4: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it.
# 1268|   			git)	: git itself ;;
# 1269|   			\(\))   : skip parens of shell function definition ;;
# 1270|-> 			{)	: skip start of shell helper function ;;
# 1271|   			:)	: skip null command ;;
# 1272|   			\'*)	: skip opening quote after sh -c ;;

Error: SHELLCHECK_WARNING (CWE-480): [#def110]
/usr/share/doc/git/contrib/completion/git-completion.bash:1370:15: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
# 1368|   {
# 1369|   	local c short_opt long_opt val
# 1370|-> 	local result= values config_key word
# 1371|   
# 1372|   	short_opt="$1"

Error: SHELLCHECK_WARNING (CWE-571): [#def111]
/usr/share/doc/git/contrib/completion/git-completion.bash:1559:8: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 1557|   	local all_subcommands="$completable_subcommands view"
# 1558|   
# 1559|-> 	local subcommand="$(__git_find_on_cmdline "$all_subcommands")"
# 1560|   
# 1561|   	if [ -z "$subcommand" ]; then

Error: SHELLCHECK_WARNING (CWE-477): [#def112]
/usr/share/doc/git/contrib/completion/git-completion.bash:1624:30: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
# 1622|   		;;
# 1623|   	*)
# 1624|-> 		if [ $only_local_ref = "y" -a $has_r = "n" ]; then
# 1625|   			__gitcomp_direct "$(__git_heads "" "$cur" " ")"
# 1626|   		else

Error: SHELLCHECK_WARNING (CWE-571): [#def113]
/usr/share/doc/git/contrib/completion/git-completion.bash:1704:8: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 1702|   	__git_has_doubledash && return
# 1703|   
# 1704|-> 	local dwim_opt="$(__git_checkout_default_dwim_mode)"
# 1705|   
# 1706|   	case "$prev" in

Error: SHELLCHECK_WARNING (CWE-156): [#def114]
/usr/share/doc/git/contrib/completion/git-completion.bash:2360:7: warning[SC2046]: Quote this to prevent word splitting.
# 2358|   	esac
# 2359|   
# 2360|-> 	if [ $(__git_count_arguments "mv") -gt 0 ]; then
# 2361|   		# We need to show both cached and untracked files (including
# 2362|   		# empty directories) since this may not be the last argument.

Error: SHELLCHECK_WARNING (CWE-571): [#def115]
/usr/share/doc/git/contrib/completion/git-completion.bash:2372:8: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 2370|   {
# 2371|   	local subcommands='add append copy edit get-ref list merge prune remove show'
# 2372|-> 	local subcommand="$(__git_find_on_cmdline "$subcommands")"
# 2373|   
# 2374|   	case "$subcommand,$cur" in

Error: SHELLCHECK_WARNING (CWE-571): [#def116]
/usr/share/doc/git/contrib/completion/git-completion.bash:2655:8: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 2653|   _git_switch ()
# 2654|   {
# 2655|-> 	local dwim_opt="$(__git_checkout_default_dwim_mode)"
# 2656|   
# 2657|   	case "$prev" in

Error: SHELLCHECK_WARNING (CWE-480): [#def117]
/usr/share/doc/git/contrib/completion/git-completion.bash:2706:34: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
# 2704|   __git_config_get_set_variables ()
# 2705|   {
# 2706|-> 	local prevword word config_file= c=$cword
# 2707|   	while [ $c -gt "$__git_cmd_idx" ]; do
# 2708|   		word="${words[c]}"

Error: SHELLCHECK_WARNING (CWE-571): [#def118]
/usr/share/doc/git/contrib/completion/git-completion.bash:3038:8: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 3036|   		get-url set-url show prune update
# 3037|   		"
# 3038|-> 	local subcommand="$(__git_find_on_cmdline "$subcommands")"
# 3039|   	if [ -z "$subcommand" ]; then
# 3040|   		case "$cur" in

Error: SHELLCHECK_WARNING (CWE-571): [#def119]
/usr/share/doc/git/contrib/completion/git-completion.bash:3105:8: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 3103|   {
# 3104|   	local subcommands="clear forget diff remaining status gc"
# 3105|-> 	local subcommand="$(__git_find_on_cmdline "$subcommands")"
# 3106|   	if test -z "$subcommand"
# 3107|   	then

Error: SHELLCHECK_WARNING (CWE-670): [#def120]
/usr/share/doc/git/contrib/completion/git-completion.bash:3266:11: warning[SC2128]: Expanding an array without an index only gives the first element.
# 3264|   	# that's fine too.
# 3265|   	[[ "$cur" =~ .*/ ]]
# 3266|-> 	_tmp_dir=$BASH_REMATCH
# 3267|   
# 3268|   	# Find possible directory completions, adding trailing '/' characters,

Error: SHELLCHECK_WARNING (CWE-140): [#def121]
/usr/share/doc/git/contrib/completion/git-completion.bash:3362:14: warning[SC2206]: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.
# 3360|   		# We found some completions; return them
# 3361|   		local IFS=$'\n'
# 3362|-> 		COMPREPLY=($completions)
# 3363|   	else
# 3364|   		# Do NOT fall back to bash-style all-local-files-and-dirs

Error: SHELLCHECK_WARNING (CWE-571): [#def122]
/usr/share/doc/git/contrib/completion/git-completion.bash:3396:8: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 3394|   {
# 3395|   	local subcommands="list init set disable add reapply"
# 3396|-> 	local subcommand="$(__git_find_on_cmdline "$subcommands")"
# 3397|   	local using_cone=true
# 3398|   	if [ -z "$subcommand" ]; then

Error: SHELLCHECK_WARNING (CWE-571): [#def123]
/usr/share/doc/git/contrib/completion/git-completion.bash:3427:8: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 3425|   {
# 3426|   	local subcommands='push list show apply clear drop pop create branch'
# 3427|-> 	local subcommand="$(__git_find_on_cmdline "$subcommands save")"
# 3428|   
# 3429|   	if [ -z "$subcommand" ]; then

Error: SHELLCHECK_WARNING (CWE-571): [#def124]
/usr/share/doc/git/contrib/completion/git-completion.bash:3475:8: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 3473|   
# 3474|   	local subcommands="add status init deinit update set-branch set-url summary foreach sync absorbgitdirs"
# 3475|-> 	local subcommand="$(__git_find_on_cmdline "$subcommands")"
# 3476|   	if [ -z "$subcommand" ]; then
# 3477|   		case "$cur" in

Error: SHELLCHECK_WARNING (CWE-571): [#def125]
/usr/share/doc/git/contrib/completion/git-completion.bash:3527:8: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 3525|   		migrate mkdirs reset gc
# 3526|   		"
# 3527|-> 	local subcommand="$(__git_find_on_cmdline "$subcommands")"
# 3528|   	if [ -z "$subcommand" ]; then
# 3529|   		__gitcomp "$subcommands"

Error: SHELLCHECK_WARNING (CWE-571): [#def126]
/usr/share/doc/git/contrib/completion/git-completion.bash:3898:8: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 3896|   	__git_complete_command "$command" && return
# 3897|   
# 3898|-> 	local expansion=$(__git_aliased_command "$command")
# 3899|   	if [ -n "$expansion" ]; then
# 3900|   		words[1]=$expansion

Error: SHELLCHECK_WARNING (CWE-758): [#def127]
/usr/share/doc/git/contrib/completion/git-prompt.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> # bash/zsh git prompt support
#    2|   #
#    3|   # Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>

Error: SHELLCHECK_WARNING (CWE-563): [#def128]
/usr/share/doc/git/contrib/completion/git-prompt.sh:159:48: warning[SC2034]: n appears unused. Verify use (or export if used externally).
#  157|   {
#  158|   	local key value
#  159|-> 	local svn_remotes="" svn_url_pattern="" count n
#  160|   	local upstream_type=git legacy="" verbose="" name=""
#  161|   	local LF="$__git_LF"

Error: SHELLCHECK_WARNING (CWE-457): [#def129]
/usr/share/doc/git/contrib/completion/git-prompt.sh:161:12: warning[SC2154]: __git_LF is referenced but not assigned.
#  159|   	local svn_remotes="" svn_url_pattern="" count n
#  160|   	local upstream_type=git legacy="" verbose="" name=""
#  161|-> 	local LF="$__git_LF"
#  162|   
#  163|   	# get some config options from git-config

Error: SHELLCHECK_WARNING (CWE-571): [#def130]
/usr/share/doc/git/contrib/completion/git-prompt.sh:164:8: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  162|   
#  163|   	# get some config options from git-config
#  164|-> 	local output="$(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')"
#  165|   	while read -r key value; do
#  166|   		case "$key" in

Error: SHELLCHECK_WARNING (CWE-571): [#def131]
/usr/share/doc/git/contrib/completion/git-prompt.sh:207:9: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  205|   		# get upstream from "git-svn-id: UPSTRM@N HASH" in a commit message
#  206|   		# (git-svn uses essentially the same procedure internally)
#  207|-> 		local svn_upstream="$(
#  208|   			git log --first-parent -1 \
#  209|   				--grep="^git-svn-id: \(${svn_url_pattern#??}\)" 2>/dev/null

Error: SHELLCHECK_WARNING (CWE-457): [#def132]
/usr/share/doc/git/contrib/completion/git-prompt.sh:317:47: warning[SC2154]: __git_ESC is referenced but not assigned.
#  315|   		# which bash/readline identify while calculating the prompt
#  316|   		# on-screen width - to exclude 0-screen-width esc sequences.
#  317|-> 		local c_pre="${GIT_PS1_COLOR_PRE-$__git_SOH}${__git_ESC}["
#  318|   		local c_post="m${GIT_PS1_COLOR_POST-$__git_STX}"
#  319|   

Error: SHELLCHECK_WARNING (CWE-457): [#def133]
/usr/share/doc/git/contrib/completion/git-prompt.sh:359:22: warning[SC2154]: __git_CRLF is referenced but not assigned.
#  357|   __git_eread ()
#  358|   {
#  359|-> 	test -r "$1" && IFS=$__git_CRLF read -r "$2" <"$1"
#  360|   }
#  361|   

Error: SHELLCHECK_WARNING (CWE-569): [#def134]
/usr/share/doc/git/contrib/completion/git-prompt.sh:575:6: warning[SC2221]: This pattern always overrides a later one on line 575.
#  573|   				(describe)
#  574|   					git describe HEAD ;;
#  575|-> 				(* | default)
#  576|   					git describe --tags --exact-match HEAD ;;
#  577|   				esac 2>/dev/null)" ||

Error: SHELLCHECK_WARNING (CWE-569): [#def135]
/usr/share/doc/git/contrib/completion/git-prompt.sh:575:10: warning[SC2222]: This pattern never matches because of a previous pattern on line 575.
#  573|   				(describe)
#  574|   					git describe HEAD ;;
#  575|-> 				(* | default)
#  576|   					git describe --tags --exact-match HEAD ;;
#  577|   				esac 2>/dev/null)" ||

Error: SHELLCHECK_WARNING (CWE-569): [#def136]
/usr/share/doc/git/contrib/coverage-diff.sh:48:1: warning[SC2188]: This redirection doesn't have a command. Move to its command (or use 'true' as no-op).
#   46|   
#   47|   # create empty file
#   48|-> >coverage-data.txt
#   49|   
#   50|   for file in $files

Error: SHELLCHECK_WARNING (CWE-477): [#def137]
/usr/share/doc/git/contrib/fast-import/git-import.sh:7:14: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#    5|   # but is meant to be a simple fast-import example.
#    6|   
#    7|-> if [ -z "$1" -o -z "$2" ]; then
#    8|   	echo "usage: git-import branch import-message"
#    9|   	exit 1

Error: SHELLCHECK_WARNING (CWE-477): [#def138]
/usr/share/doc/git/contrib/fast-import/git-import.sh:15:21: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#   13|   EMAIL="$(git config user.email)"
#   14|   
#   15|-> if [ -z "$USERNAME" -o -z "$EMAIL" ]; then
#   16|   	echo "You need to set user name and email"
#   17|   	exit 1

Error: SHELLCHECK_WARNING (CWE-156): [#def139]
/usr/share/doc/git/contrib/fast-import/git-import.sh:33:13: warning[SC2046]: Quote this to prevent word splitting.
#   31|   	find * -type f|while read i;do
#   32|   		echo "M 100644 inline $i"
#   33|-> 		echo data $(stat -c '%s' "$i")
#   34|   		cat "$i"
#   35|   		echo

Error: SHELLCHECK_WARNING (CWE-563): [#def140]
/usr/share/doc/git/contrib/git-resurrect.sh:4:1: warning[SC2034]: LONG_USAGE appears unused. Verify use (or export if used externally).
#    2|   
#    3|   USAGE="[-a] [-r] [-m] [-t] [-n] [-b <newname>] <name>"
#    4|-> LONG_USAGE="git-resurrect attempts to find traces of a branch tip
#    5|   called <name>, and tries to resurrect it.  Currently, the reflog is
#    6|   searched for checkout messages, and with -r also merge messages.  With

Error: SHELLCHECK_WARNING (CWE-563): [#def141]
/usr/share/doc/git/contrib/git-resurrect.sh:12:1: warning[SC2034]: OPTIONS_KEEPDASHDASH appears unused. Verify use (or export if used externally).
#   10|   branches."
#   11|   
#   12|-> OPTIONS_KEEPDASHDASH=
#   13|   OPTIONS_STUCKLONG=
#   14|   OPTIONS_SPEC="\

Error: SHELLCHECK_WARNING (CWE-563): [#def142]
/usr/share/doc/git/contrib/git-resurrect.sh:13:1: warning[SC2034]: OPTIONS_STUCKLONG appears unused. Verify use (or export if used externally).
#   11|   
#   12|   OPTIONS_KEEPDASHDASH=
#   13|-> OPTIONS_STUCKLONG=
#   14|   OPTIONS_SPEC="\
#   15|   git resurrect $USAGE

Error: SHELLCHECK_WARNING (CWE-563): [#def143]
/usr/share/doc/git/contrib/git-resurrect.sh:14:1: warning[SC2034]: OPTIONS_SPEC appears unused. Verify use (or export if used externally).
#   12|   OPTIONS_KEEPDASHDASH=
#   13|   OPTIONS_STUCKLONG=
#   14|-> OPTIONS_SPEC="\
#   15|   git resurrect $USAGE
#   16|   --

Error: SHELLCHECK_WARNING (CWE-156): [#def144]
/usr/share/doc/git/contrib/git-resurrect.sh:34:16: warning[SC2046]: Quote this to prevent word splitting.
#   32|   
#   33|   search_reflog_merges () {
#   34|-> 	git rev-parse $(
#   35|   		sed -ne 's~^[^ ]* \([^ ]*\) .*	merge '"$1"':.*~\1^2~p' \
#   36|   			< "$GIT_DIR"/logs/HEAD

Error: SHELLCHECK_WARNING (CWE-758): [#def145]
/usr/share/doc/git/contrib/mw-to-git/t/push-pull-tests.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> test_push_pull () {
#    2|   
#    3|   	test_expect_success 'Git pull works after adding a new wiki page' '

Error: SHELLCHECK_WARNING (CWE-563): [#def146]
/usr/share/doc/git/contrib/mw-to-git/t/t9360-mw-to-git-clone.sh:13:1: warning[SC2034]: test_description appears unused. Verify use (or export if used externally).
#   11|   
#   12|   
#   13|-> test_description='Test the Git Mediawiki remote helper: git clone'
#   14|   
#   15|   . ./test-gitmw-lib.sh

Error: SHELLCHECK_WARNING (CWE-563): [#def147]
/usr/share/doc/git/contrib/mw-to-git/t/t9361-mw-to-git-push-pull.sh:14:1: warning[SC2034]: test_description appears unused. Verify use (or export if used externally).
#   12|   # tests for git-remote-mediawiki
#   13|   
#   14|-> test_description='Test the Git Mediawiki remote helper: git push and git pull simple test cases'
#   15|   
#   16|   . ./test-gitmw-lib.sh

Error: SHELLCHECK_WARNING (CWE-563): [#def148]
/usr/share/doc/git/contrib/mw-to-git/t/t9362-mw-to-git-utf8.sh:14:1: warning[SC2034]: test_description appears unused. Verify use (or export if used externally).
#   12|   # tests for git-remote-mediawiki
#   13|   
#   14|-> test_description='Test git-mediawiki with special characters in filenames'
#   15|   
#   16|   . ./test-gitmw-lib.sh

Error: SHELLCHECK_WARNING (CWE-563): [#def149]
/usr/share/doc/git/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh:14:1: warning[SC2034]: test_description appears unused. Verify use (or export if used externally).
#   12|   # tests for git-remote-mediawiki
#   13|   
#   14|-> test_description='Test the Git Mediawiki remote helper: git push and git pull simple test cases'
#   15|   
#   16|   . ./test-gitmw-lib.sh

Error: SHELLCHECK_WARNING (CWE-563): [#def150]
/usr/share/doc/git/contrib/mw-to-git/t/t9364-pull-by-rev.sh:3:1: warning[SC2034]: test_description appears unused. Verify use (or export if used externally).
#    1|   #!/bin/sh
#    2|   
#    3|-> test_description='Test the Git Mediawiki remote helper: git pull by revision'
#    4|   
#    5|   . ./test-gitmw-lib.sh

Error: SHELLCHECK_WARNING (CWE-563): [#def151]
/usr/share/doc/git/contrib/mw-to-git/t/t9365-continuing-queries.sh:3:1: warning[SC2034]: test_description appears unused. Verify use (or export if used externally).
#    1|   #!/bin/sh
#    2|   
#    3|-> test_description='Test the Git Mediawiki remote helper: queries w/ more than 500 results'
#    4|   
#    5|   . ./test-gitmw-lib.sh

Error: SHELLCHECK_WARNING (CWE-758): [#def152]
/usr/share/doc/git/contrib/mw-to-git/t/test-gitmw-lib.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> # Copyright (C) 2012
#    2|   #     Charles Roussel <charles.roussel@ensimag.imag.fr>
#    3|   #     Simon Cathebras <simon.cathebras@ensimag.imag.fr>

Error: SHELLCHECK_WARNING (CWE-563): [#def153]
/usr/share/doc/git/contrib/mw-to-git/t/test-gitmw-lib.sh:71:3: warning[SC2034]: skip_all appears unused. Verify use (or export if used externally).
#   69|   	if ! test -d "$WIKI_DIR_INST/$WIKI_DIR_NAME"
#   70|   	then
#   71|-> 		skip_all='skipping gateway git-mw tests, no mediawiki found'
#   72|   		test_done
#   73|   	fi

Error: SHELLCHECK_WARNING (CWE-156): [#def154]
/usr/share/doc/git/contrib/mw-to-git/t/test-gitmw-lib.sh:94:10: warning[SC2046]: Quote this to prevent word splitting.
#   92|   # Check that <dir> contains exactly <N> files
#   93|   test_contains_N_files () {
#   94|-> 	if test $(ls -- "$1" | wc -l) -ne "$2"; then
#   95|   		echo "directory $1 should contain $2 files"
#   96|   		echo "it contains these files:"

Error: SHELLCHECK_WARNING (CWE-156): [#def155]
/usr/share/doc/git/contrib/mw-to-git/t/test-gitmw-lib.sh:292:33: warning[SC2046]: Quote this to prevent word splitting.
#  290|   # Kill daemon lighttpd and removes files and folders associated.
#  291|   stop_lighttpd () {
#  292|-> 	test -f "$WEB_TMP/pid" && kill $(cat "$WEB_TMP/pid")
#  293|   }
#  294|   

Error: SHELLCHECK_WARNING (CWE-398): [#def156]
/usr/share/doc/git/contrib/mw-to-git/t/test-gitmw-lib.sh:297:5: warning[SC2115]: Use "${var:?}" to ensure this never expands to /* .
#  295|   wiki_delete_db () {
#  296|   	rm -rf \
#  297|-> 	   "$FILES_FOLDER_DB"/* || error "Couldn't delete $FILES_FOLDER_DB/"
#  298|   }
#  299|   

Error: SHELLCHECK_WARNING (CWE-398): [#def157]
/usr/share/doc/git/contrib/mw-to-git/t/test-gitmw-lib.sh:302:5: warning[SC2115]: Use "${var:?}" to ensure this never expands to /* .
#  300|   wiki_delete_db_backup () {
#  301|   	rm -rf \
#  302|-> 	   "$FILES_FOLDER_POST_INSTALL_DB"/* || error "Couldn't delete $FILES_FOLDER_POST_INSTALL_DB/"
#  303|   }
#  304|   

Error: SHELLCHECK_WARNING (CWE-398): [#def158]
/usr/share/doc/git/contrib/mw-to-git/t/test-gitmw-lib.sh:426:10: warning[SC2115]: Use "${var:?}" to ensure this never expands to / .
#  424|   	else
#  425|   		# Delete the wiki's directory.
#  426|-> 		rm -rf "$WIKI_DIR_INST/$WIKI_DIR_NAME" ||
#  427|   			error "Wiki's directory $WIKI_DIR_INST/" \
#  428|   			"$WIKI_DIR_NAME could not be deleted"

Error: SHELLCHECK_WARNING (CWE-252): [#def159]
/usr/share/doc/git/contrib/remotes2config.sh:12:3: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
#   10|   	# rewrite into config
#   11|   	{
#   12|-> 		cd "$GIT_DIR"/remotes
#   13|   		ls | while read f; do
#   14|   			name=$(printf "$f" | tr -c "A-Za-z0-9-" ".")

Error: SHELLCHECK_WARNING (CWE-398): [#def160]
/usr/share/doc/git/contrib/remotes2config.sh:21:8: warning[SC1010]: Use semicolon or linefeed before 'done' (or quote to make it literal).
#   19|   			< "$f"
#   20|   		done
#   21|-> 		echo done
#   22|   	} | while read key value regex; do
#   23|   		case $key in

Error: SHELLCHECK_WARNING (CWE-149): [#def161]
/usr/share/doc/git/contrib/remotes2config.sh:29:27: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them.
#   27|   			fi ;;
#   28|   		*)
#   29|-> 			echo "git config $key "$value" $regex"
#   30|   			git config $key "$value" $regex || error=1 ;;
#   31|   		esac

Error: SHELLCHECK_WARNING (CWE-563): [#def162]
/usr/share/doc/git/contrib/rerere-train.sh:14:1: warning[SC2034]: SUBDIRECTORY_OK appears unused. Verify use (or export if used externally).
#   12|   )
#   13|   
#   14|-> SUBDIRECTORY_OK=Yes
#   15|   
#   16|   overwrite=0

Error: SHELLCHECK_WARNING (CWE-252): [#def163]
/usr/share/doc/git/contrib/thunderbird-patch-inline/appp.sh:14:2: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
#   12|   if [ -e "$CONFFILE" ] ; then
#   13|   	LAST_DIR=$(grep -m 1 "^LAST_DIR=" "${CONFFILE}"|sed -e 's/^LAST_DIR=//')
#   14|-> 	cd "${LAST_DIR}"
#   15|   else
#   16|   	cd > /dev/null

Error: SHELLCHECK_WARNING (CWE-252): [#def164]
/usr/share/doc/git/contrib/thunderbird-patch-inline/appp.sh:16:2: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
#   14|   	cd "${LAST_DIR}"
#   15|   else
#   16|-> 	cd > /dev/null
#   17|   fi
#   18|   

Error: SHELLCHECK_WARNING (CWE-252): [#def165]
/usr/share/doc/git/contrib/thunderbird-patch-inline/appp.sh:26:1: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
#   24|   fi
#   25|   
#   26|-> cd - > /dev/null
#   27|   
#   28|   SUBJECT=$(sed -n -e '/^Subject: /p' "${PATCH}")

Error: SHELLCHECK_WARNING: [#def166]
/usr/share/doc/git/contrib/thunderbird-patch-inline/appp.sh:34:12: warning[SC3037]: In POSIX sh, echo flags are undefined.
#   32|   DIFF=$(sed -e '1,/^---$/d' "${PATCH}")
#   33|   
#   34|-> CCS=$(echo -e "$CMT_MSG\n$HEADERS" | sed -n -e 's/^Cc: \(.*\)$/\1,/gp' \
#   35|   	-e 's/^Signed-off-by: \(.*\)/\1,/gp')
#   36|   

Error: SHELLCHECK_WARNING (CWE-252): [#def167]
/usr/share/doc/git/contrib/update-unicode/update_unicode.sh:8:1: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
#    6|   #Cf Format          a format control character
#    7|   #
#    8|-> cd "$(dirname "$0")"
#    9|   UNICODEWIDTH_H=$(git rev-parse --show-toplevel)/unicode-width.h
#   10|   

Error: SHELLCHECK_WARNING (CWE-758): [#def168]
/usr/share/git-core/contrib/completion/git-prompt.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> # bash/zsh git prompt support
#    2|   #
#    3|   # Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>

Error: SHELLCHECK_WARNING (CWE-563): [#def169]
/usr/share/git-core/contrib/completion/git-prompt.sh:159:48: warning[SC2034]: n appears unused. Verify use (or export if used externally).
#  157|   {
#  158|   	local key value
#  159|-> 	local svn_remotes="" svn_url_pattern="" count n
#  160|   	local upstream_type=git legacy="" verbose="" name=""
#  161|   	local LF="$__git_LF"

Error: SHELLCHECK_WARNING (CWE-457): [#def170]
/usr/share/git-core/contrib/completion/git-prompt.sh:161:12: warning[SC2154]: __git_LF is referenced but not assigned.
#  159|   	local svn_remotes="" svn_url_pattern="" count n
#  160|   	local upstream_type=git legacy="" verbose="" name=""
#  161|-> 	local LF="$__git_LF"
#  162|   
#  163|   	# get some config options from git-config

Error: SHELLCHECK_WARNING (CWE-571): [#def171]
/usr/share/git-core/contrib/completion/git-prompt.sh:164:8: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  162|   
#  163|   	# get some config options from git-config
#  164|-> 	local output="$(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')"
#  165|   	while read -r key value; do
#  166|   		case "$key" in

Error: SHELLCHECK_WARNING (CWE-571): [#def172]
/usr/share/git-core/contrib/completion/git-prompt.sh:207:9: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  205|   		# get upstream from "git-svn-id: UPSTRM@N HASH" in a commit message
#  206|   		# (git-svn uses essentially the same procedure internally)
#  207|-> 		local svn_upstream="$(
#  208|   			git log --first-parent -1 \
#  209|   				--grep="^git-svn-id: \(${svn_url_pattern#??}\)" 2>/dev/null

Error: SHELLCHECK_WARNING (CWE-457): [#def173]
/usr/share/git-core/contrib/completion/git-prompt.sh:317:47: warning[SC2154]: __git_ESC is referenced but not assigned.
#  315|   		# which bash/readline identify while calculating the prompt
#  316|   		# on-screen width - to exclude 0-screen-width esc sequences.
#  317|-> 		local c_pre="${GIT_PS1_COLOR_PRE-$__git_SOH}${__git_ESC}["
#  318|   		local c_post="m${GIT_PS1_COLOR_POST-$__git_STX}"
#  319|   

Error: SHELLCHECK_WARNING (CWE-457): [#def174]
/usr/share/git-core/contrib/completion/git-prompt.sh:359:22: warning[SC2154]: __git_CRLF is referenced but not assigned.
#  357|   __git_eread ()
#  358|   {
#  359|-> 	test -r "$1" && IFS=$__git_CRLF read -r "$2" <"$1"
#  360|   }
#  361|   

Error: SHELLCHECK_WARNING (CWE-569): [#def175]
/usr/share/git-core/contrib/completion/git-prompt.sh:575:6: warning[SC2221]: This pattern always overrides a later one on line 575.
#  573|   				(describe)
#  574|   					git describe HEAD ;;
#  575|-> 				(* | default)
#  576|   					git describe --tags --exact-match HEAD ;;
#  577|   				esac 2>/dev/null)" ||

Error: SHELLCHECK_WARNING (CWE-569): [#def176]
/usr/share/git-core/contrib/completion/git-prompt.sh:575:10: warning[SC2222]: This pattern never matches because of a previous pattern on line 575.
#  573|   				(describe)
#  574|   					git describe HEAD ;;
#  575|-> 				(* | default)
#  576|   					git describe --tags --exact-match HEAD ;;
#  577|   				esac 2>/dev/null)" ||

Error: SHELLCHECK_WARNING (CWE-156): [#def177]
/usr/share/git-core/contrib/hooks/post-receive-email:511:7: warning[SC2046]: Quote this to prevent word splitting.
#  509|   	# Use git for-each-ref to pull out the individual fields from the
#  510|   	# tag
#  511|-> 	eval $(git for-each-ref --shell --format='
#  512|   	tagobject=%(*objectname)
#  513|   	tagtype=%(*objecttype)

Error: SHELLCHECK_WARNING (CWE-457): [#def178]
/usr/share/git-core/contrib/hooks/post-receive-email:518:20: warning[SC2154]: tagobject is referenced but not assigned.
#  516|   	)
#  517|   
#  518|-> 	echo "   tagging  $tagobject ($tagtype)"
#  519|   	case "$tagtype" in
#  520|   	commit)

Error: SHELLCHECK_WARNING (CWE-457): [#def179]
/usr/share/git-core/contrib/hooks/post-receive-email:518:32: warning[SC2154]: tagtype is referenced but not assigned.
#  516|   	)
#  517|   
#  518|-> 	echo "   tagging  $tagobject ($tagtype)"
#  519|   	case "$tagtype" in
#  520|   	commit)

Error: SHELLCHECK_WARNING (CWE-457): [#def180]
/usr/share/git-core/contrib/hooks/post-receive-email:535:20: warning[SC2154]: tagger is referenced but not assigned.
#  533|   		;;
#  534|   	esac
#  535|-> 	echo " tagged by  $tagger"
#  536|   	echo "        on  $tagged"
#  537|   

Error: SHELLCHECK_WARNING (CWE-457): [#def181]
/usr/share/git-core/contrib/hooks/post-receive-email:536:20: warning[SC2154]: tagged is referenced but not assigned.
#  534|   	esac
#  535|   	echo " tagged by  $tagger"
#  536|-> 	echo "        on  $tagged"
#  537|   
#  538|   	echo ""

Error: SHELLCHECK_WARNING (CWE-156): [#def182]
/usr/share/git-core/contrib/hooks/post-receive-email:680:9: warning[SC2046]: Quote this to prevent word splitting.
#  678|   		while read onerev
#  679|   		do
#  680|-> 			eval $(printf "$custom_showrev" $onerev)
#  681|   		done
#  682|   	fi

Error: SHELLCHECK_WARNING (CWE-477): [#def183]
/usr/share/git-core/contrib/hooks/post-receive-email:748:14: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#  746|   # Allow dual mode: run from the command line just like the update hook, or
#  747|   # if no arguments are given then run as a hook script
#  748|-> if [ -n "$1" -a -n "$2" -a -n "$3" ]; then
#  749|   	# Output to the terminal in command line mode - if someone wanted to
#  750|   	# resend an email; they could redirect the output to sendmail

Error: SHELLCHECK_WARNING (CWE-477): [#def184]
/usr/share/git-core/contrib/hooks/post-receive-email:748:25: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#  746|   # Allow dual mode: run from the command line just like the update hook, or
#  747|   # if no arguments are given then run as a hook script
#  748|-> if [ -n "$1" -a -n "$2" -a -n "$3" ]; then
#  749|   	# Output to the terminal in command line mode - if someone wanted to
#  750|   	# resend an email; they could redirect the output to sendmail

Error: SHELLCHECK_WARNING (CWE-480): [#def185]
/usr/share/git-core/contrib/hooks/post-receive-email:752:35: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
#  750|   	# resend an email; they could redirect the output to sendmail
#  751|   	# themselves
#  752|-> 	prep_for_email $2 $3 $1 && PAGER= generate_email
#  753|   else
#  754|   	while read oldrev newrev refname

Error: SHELLCHECK_WARNING (CWE-156): [#def186]
/usr/share/git-core/templates/hooks/pre-commit.sample:31:7: warning[SC2046]: Quote this to prevent word splitting.
#   29|   	# even required, for portability to Solaris 10's /usr/bin/tr), since
#   30|   	# the square bracket bytes happen to fall in the designated range.
#   31|-> 	test $(git diff-index --cached --name-only --diff-filter=A -z $against |
#   32|   	  LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
#   33|   then

Error: SHELLCHECK_WARNING (CWE-563): [#def187]
/usr/share/git-core/templates/hooks/pre-push.sample:22:1: warning[SC2034]: remote appears unused. Verify use (or export if used externally).
#   20|   # with "WIP" (work in progress).
#   21|   
#   22|-> remote="$1"
#   23|   url="$2"
#   24|   

Error: SHELLCHECK_WARNING (CWE-563): [#def188]
/usr/share/git-core/templates/hooks/pre-push.sample:23:1: warning[SC2034]: url appears unused. Verify use (or export if used externally).
#   21|   
#   22|   remote="$1"
#   23|-> url="$2"
#   24|   
#   25|   zero=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')

Error: SHELLCHECK_WARNING (CWE-563): [#def189]
/usr/share/git-core/templates/hooks/pre-push.sample:27:32: warning[SC2034]: remote_ref appears unused. Verify use (or export if used externally).
#   25|   zero=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')
#   26|   
#   27|-> while read local_ref local_oid remote_ref remote_oid
#   28|   do
#   29|   	if test "$local_oid" = "$zero"

Error: SHELLCHECK_WARNING (CWE-563): [#def190]
/usr/share/git-core/templates/hooks/pre-rebase.sample:19:1: warning[SC2034]: basebranch appears unused. Verify use (or export if used externally).
#   17|   
#   18|   publish=next
#   19|-> basebranch="$1"
#   20|   if test "$#" = 2
#   21|   then

Error: SHELLCHECK_WARNING (CWE-569): [#def191]
/usr/share/git-core/templates/hooks/pre-rebase.sample:91:1: warning[SC2188]: This redirection doesn't have a command. Move to its command (or use 'true' as no-op).
#   89|   fi
#   90|   
#   91|-> <<\DOC_END
#   92|   
#   93|   This sample hook safeguards topic branches that have been

Error: SHELLCHECK_WARNING (CWE-457): [#def192]
/usr/share/git-core/templates/hooks/pre-receive.sample:15:9: warning[SC2154]: value is referenced but not assigned.
#   13|   	do
#   14|   		eval "value=\$GIT_PUSH_OPTION_$i"
#   15|-> 		case "$value" in
#   16|   		echoback=*)
#   17|   			echo "echo from the pre-receive-hook: ${value#*=}" >&2

Error: SHELLCHECK_WARNING (CWE-563): [#def193]
/usr/share/git-core/templates/hooks/prepare-commit-msg.sample:24:1: warning[SC2034]: COMMIT_SOURCE appears unused. Verify use (or export if used externally).
#   22|   
#   23|   COMMIT_MSG_FILE=$1
#   24|-> COMMIT_SOURCE=$2
#   25|   SHA1=$3
#   26|   

Error: SHELLCHECK_WARNING (CWE-563): [#def194]
/usr/share/git-core/templates/hooks/prepare-commit-msg.sample:25:1: warning[SC2034]: SHA1 appears unused. Verify use (or export if used externally).
#   23|   COMMIT_MSG_FILE=$1
#   24|   COMMIT_SOURCE=$2
#   25|-> SHA1=$3
#   26|   
#   27|   /usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE"

Error: SHELLCHECK_WARNING (CWE-477): [#def195]
/usr/share/git-core/templates/hooks/update.sample:40:20: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#   38|   fi
#   39|   
#   40|-> if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
#   41|   	echo "usage: $0 <ref> <oldrev> <newrev>" >&2
#   42|   	exit 1

Error: SHELLCHECK_WARNING (CWE-477): [#def196]
/usr/share/git-core/templates/hooks/update.sample:40:36: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#   38|   fi
#   39|   
#   40|-> if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
#   41|   	echo "usage: $0 <ref> <oldrev> <newrev>" >&2
#   42|   	exit 1

Error: SHELLCHECK_WARNING (CWE-477): [#def197]
/usr/share/git-core/templates/hooks/update.sample:98:28: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#   96|   	refs/heads/*,commit)
#   97|   		# branch
#   98|-> 		if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then
#   99|   			echo "*** Creating a branch is not allowed in this repository" >&2
#  100|   			exit 1

Error: GCC_ANALYZER_WARNING (CWE-476): [#def198]
git-2.47.0-build/git-2.47.0/add-patch.c:3: included_from: Included from here.
git-2.47.0-build/git-2.47.0/add-patch.c: scope_hint: In function ‘parse_diff’
git-2.47.0-build/git-2.47.0/add-patch.c:529:65: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘file_diff’
git-2.47.0-build/git-2.47.0/git-compat-util.h:1265:41: note: in definition of macro ‘ALLOC_GROW_BY’
git-2.47.0-build/git-2.47.0/add-patch.c: scope_hint: In function ‘parse_diff’
git-2.47.0-build/git-2.47.0/git-compat-util.h:1265:41: note: in definition of macro ‘ALLOC_GROW_BY’
git-2.47.0-build/git-2.47.0/git-compat-util.h:1265:41: note: in definition of macro ‘ALLOC_GROW_BY’
#  527|   				hunk->splittable_into++;
#  528|   
#  529|-> 			ALLOC_GROW_BY(file_diff->hunk, file_diff->hunk_nr, 1,
#  530|   				   file_diff->hunk_alloc);
#  531|   			hunk = file_diff->hunk + file_diff->hunk_nr - 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def199]
git-2.47.0-build/git-2.47.0/add-patch.c:606:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘hunk’
git-2.47.0-build/git-2.47.0/add-patch.c: scope_hint: In function ‘parse_diff’
#  604|   
#  605|   		p = eol == pend ? pend : eol + 1;
#  606|-> 		hunk->end = p - plain->buf;
#  607|   
#  608|   		if (colored) {

Error: GCC_ANALYZER_WARNING: [#def200]
git-2.47.0-build/git-2.47.0/archive-tar.c: scope_hint: In function ‘write_tar_filter_archive’
git-2.47.0-build/git-2.47.0/archive-tar.c:515:13: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
#  513|   		die_errno(_("unable to start '%s' filter"), cmd.buf);
#  514|   	close(1);
#  515|-> 	if (dup2(filter.in, 1) < 0)
#  516|   		die_errno(_("unable to redirect descriptor"));
#  517|   	close(filter.in);

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def201]
git-2.47.0-build/git-2.47.0/archive-tar.c:521:9: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘1’
#  519|   	r = write_tar_archive(ar, args);
#  520|   
#  521|-> 	close(1);
#  522|   	if (finish_command(&filter) != 0)
#  523|   		die(_("'%s' filter reported error"), cmd.buf);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def202]
git-2.47.0-build/git-2.47.0/blame.c: scope_hint: In function ‘setup_scoreboard’
git-2.47.0-build/git-2.47.0/blame.c:2841:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘c’
git-2.47.0-build/git-2.47.0/blame.c: scope_hint: In function ‘setup_scoreboard’
# 2839|   
# 2840|   		sb->revs->children.name = "children";
# 2841|-> 		while (c->parents &&
# 2842|   		       !oideq(&c->object.oid, &sb->final->object.oid)) {
# 2843|   			struct commit_list *l = xcalloc(1, sizeof(*l));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def203]
git-2.47.0-build/git-2.47.0/builtin/archive.c: scope_hint: In function ‘create_output_file’
git-2.47.0-build/git-2.47.0/builtin/archive.c:17:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(xopen(output_file, 577, 438), 1)’
#   15|   	int output_fd = xopen(output_file, O_CREAT | O_WRONLY | O_TRUNC, 0666);
#   16|   	if (output_fd != 1) {
#   17|-> 		if (dup2(output_fd, 1) < 0)
#   18|   			die_errno(_("could not redirect output"));
#   19|   		else

Error: GCC_ANALYZER_WARNING (CWE-457): [#def204]
git-2.47.0-build/git-2.47.0/builtin/cat-file.c: scope_hint: In function ‘cat_one_file’
git-2.47.0-build/git-2.47.0/builtin/cat-file.c:155:56: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘type’
#  153|   			die("git cat-file: could not get object info");
#  154|   
#  155|-> 		if (use_mailmap && (type == OBJ_COMMIT || type == OBJ_TAG)) {
#  156|   			size_t s = size;
#  157|   			buf = replace_idents_using_mailmap(buf, &s);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def205]
git-2.47.0-build/git-2.47.0/builtin/gc.c: scope_hint: In function ‘is_crontab_available’
git-2.47.0-build/git-2.47.0/builtin/gc.c:2345:15: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cmd’
git-2.47.0-build/git-2.47.0/builtin/gc.c: scope_hint: In function ‘is_crontab_available’
# 2343|   	ret = 0;
# 2344|   #else
# 2345|-> 	ret = check_crontab_process(cmd);
# 2346|   #endif
# 2347|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def206]
git-2.47.0-build/git-2.47.0/builtin/interpret-trailers.c: scope_hint: In function ‘create_in_place_tempfile’
git-2.47.0-build/git-2.47.0/builtin/interpret-trailers.c:104:13: warning[-Wanalyzer-null-argument]: use of NULL ‘file’ where non-null expected
git-2.47.0-build/git-2.47.0/builtin/interpret-trailers.c: scope_hint: In function ‘create_in_place_tempfile’
/usr/include/features.h:511: included_from: Included from here.
/usr/include/unistd.h:25: included_from: Included from here.
git-2.47.0-build/git-2.47.0/git-compat-util.h:246: included_from: Included from here.
git-2.47.0-build/git-2.47.0/builtin.h:4: included_from: Included from here.
git-2.47.0-build/git-2.47.0/builtin/interpret-trailers.c:8: included_from: Included from here.
/usr/include/sys/stat.h:227:12: note: argument 1 of ‘stat’ must be non-null
#  102|   	FILE *outfile;
#  103|   
#  104|-> 	if (stat(file, &st))
#  105|   		die_errno(_("could not stat %s"), file);
#  106|   	if (!S_ISREG(st.st_mode))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def207]
git-2.47.0-build/git-2.47.0/builtin/name-rev.c: scope_hint: In function ‘name_rev’
git-2.47.0-build/git-2.47.0/builtin/name-rev.c:224:50: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
git-2.47.0-build/git-2.47.0/commit-slab-impl.h:88:16: note: in definition of macro ‘implement_commit_slab’
git-2.47.0-build/git-2.47.0/commit-slab.h:64:9: note: in expansion of macro ‘implement_static_commit_slab’
git-2.47.0-build/git-2.47.0/builtin/name-rev.c:34:1: note: in expansion of macro ‘define_commit_slab’
git-2.47.0-build/git-2.47.0/builtin/name-rev.c: scope_hint: In function ‘name_rev’
git-2.47.0-build/git-2.47.0/commit-slab-impl.h:52:17: note: in definition of macro ‘implement_commit_slab’
git-2.47.0-build/git-2.47.0/commit-slab.h:64:9: note: in expansion of macro ‘implement_static_commit_slab’
git-2.47.0-build/git-2.47.0/builtin/name-rev.c:34:1: note: in expansion of macro ‘define_commit_slab’
git-2.47.0-build/git-2.47.0/commit-slab-impl.h:5:9: note: in expansion of macro ‘implement_commit_slab’
git-2.47.0-build/git-2.47.0/commit-slab.h:64:9: note: in expansion of macro ‘implement_static_commit_slab’
git-2.47.0-build/git-2.47.0/builtin/name-rev.c:34:1: note: in expansion of macro ‘define_commit_slab’
git-2.47.0-build/git-2.47.0/commit-slab-impl.h:88:16: note: in definition of macro ‘implement_commit_slab’
git-2.47.0-build/git-2.47.0/commit-slab.h:64:9: note: in expansion of macro ‘implement_static_commit_slab’
git-2.47.0-build/git-2.47.0/builtin/name-rev.c:34:1: note: in expansion of macro ‘define_commit_slab’
git-2.47.0-build/git-2.47.0/builtin/name-rev.c: scope_hint: In function ‘name_rev’
#  222|   				distance = name->distance + MERGE_TRAVERSAL_WEIGHT;
#  223|   			} else {
#  224|-> 				generation = name->generation + 1;
#  225|   				distance = name->distance + 1;
#  226|   			}

Error: GCC_ANALYZER_WARNING (CWE-688): [#def208]
git-2.47.0-build/git-2.47.0/builtin/pull.c: scope_hint: In function ‘get_tracking_branch’
git-2.47.0-build/git-2.47.0/builtin/pull.c:754:22: warning[-Wanalyzer-null-argument]: use of NULL ‘remote’ where non-null expected
git-2.47.0-build/git-2.47.0/builtin/pull.c: scope_hint: In function ‘get_tracking_branch’
git-2.47.0-build/git-2.47.0/git-compat-util.h:254: included_from: Included from here.
git-2.47.0-build/git-2.47.0/builtin.h:4: included_from: Included from here.
git-2.47.0-build/git-2.47.0/builtin/pull.c:10: included_from: Included from here.
/usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null
#  752|   
#  753|   	if (*spec_src) {
#  754|-> 		if (!strcmp(remote, "."))
#  755|   			merge_branch = mkpath("refs/heads/%s", spec_src);
#  756|   		else

Error: GCC_ANALYZER_WARNING (CWE-688): [#def209]
git-2.47.0-build/git-2.47.0/builtin/sparse-checkout.c: scope_hint: In function ‘sparse_checkout_check_rules’
git-2.47.0-build/git-2.47.0/builtin/sparse-checkout.c:1022:17: warning[-Wanalyzer-null-argument]: use of NULL ‘xfopen(check_rules_opts.rules_file, "r")’ where non-null expected
git-2.47.0-build/git-2.47.0/dir.h:8: included_from: Included from here.
git-2.47.0-build/git-2.47.0/builtin/sparse-checkout.c:4: included_from: Included from here.
git-2.47.0-build/git-2.47.0/git-compat-util.h:269: included_from: Included from here.
git-2.47.0-build/git-2.47.0/builtin.h:4: included_from: Included from here.
git-2.47.0-build/git-2.47.0/builtin/sparse-checkout.c:2: included_from: Included from here.
git-2.47.0-build/git-2.47.0/builtin/sparse-checkout.c: scope_hint: In function ‘sparse_checkout_check_rules’
git-2.47.0-build/git-2.47.0/git-compat-util.h:247: included_from: Included from here.
/usr/include/stdio.h:184:12: note: argument 1 of ‘fclose’ must be non-null
# 1020|   		fp = xfopen(check_rules_opts.rules_file, "r");
# 1021|   		add_patterns_from_input(&pl, argc, argv, fp);
# 1022|-> 		fclose(fp);
# 1023|   	} else {
# 1024|   		sparse_filename = get_sparse_checkout_filename();

Error: GCC_ANALYZER_WARNING (CWE-457): [#def210]
git-2.47.0-build/git-2.47.0/builtin/submodule--helper.c: scope_hint: In function ‘get_default_remote’
git-2.47.0-build/git-2.47.0/builtin/submodule--helper.c:97:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘default_remote’
git-2.47.0-build/git-2.47.0/builtin/submodule--helper.c: scope_hint: In function ‘get_default_remote’
git-2.47.0-build/git-2.47.0/builtin/submodule--helper.c:5: included_from: Included from here.
#   95|   		exit(code);
#   96|   
#   97|-> 	return default_remote;
#   98|   }
#   99|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def211]
git-2.47.0-build/git-2.47.0/builtin/submodule--helper.c: scope_hint: In function ‘sync_submodule’
git-2.47.0-build/git-2.47.0/builtin/submodule--helper.c:1296:22: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘default_remote’
git-2.47.0-build/git-2.47.0/path.h:228: included_from: Included from here.
git-2.47.0-build/git-2.47.0/builtin/submodule--helper.c:11: included_from: Included from here.
git-2.47.0-build/git-2.47.0/builtin/submodule--helper.c:1282:9: note: in expansion of macro ‘strbuf_reset’
git-2.47.0-build/git-2.47.0/git-compat-util.h:269: included_from: Included from here.
git-2.47.0-build/git-2.47.0/builtin.h:4: included_from: Included from here.
git-2.47.0-build/git-2.47.0/builtin/submodule--helper.c:2: included_from: Included from here.
git-2.47.0-build/git-2.47.0/builtin/submodule--helper.c:1282:9: note: in expansion of macro ‘strbuf_reset’
git-2.47.0-build/git-2.47.0/builtin/submodule--helper.c:1291:9: note: in expansion of macro ‘strbuf_reset’
git-2.47.0-build/git-2.47.0/builtin/submodule--helper.c:1291:9: note: in expansion of macro ‘strbuf_reset’
git-2.47.0-build/git-2.47.0/builtin/submodule--helper.c:1291:9: note: in expansion of macro ‘strbuf_reset’
# 1294|   		exit(code);
# 1295|   
# 1296|-> 	remote_key = xstrfmt("remote.%s.url", default_remote);
# 1297|   	free(default_remote);
# 1298|   

Error: GCC_ANALYZER_WARNING: [#def212]
git-2.47.0-build/git-2.47.0/column.c: scope_hint: In function ‘run_column_filter’
git-2.47.0-build/git-2.47.0/column.c:393:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
#  391|   	fd_out = dup(1);
#  392|   	close(1);
#  393|-> 	dup2(column_process.in, 1);
#  394|   	close(column_process.in);
#  395|   	return 0;

Error: GCC_ANALYZER_WARNING: [#def213]
git-2.47.0-build/git-2.47.0/column.c: scope_hint: In function ‘stop_column_filter’
git-2.47.0-build/git-2.47.0/column.c:406:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
#  404|   	close(1);
#  405|   	finish_command(&column_process);
#  406|-> 	dup2(fd_out, 1);
#  407|   	close(fd_out);
#  408|   	fd_out = -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def214]
git-2.47.0-build/git-2.47.0/combine-diff.c: scope_hint: In function ‘show_patch_diff’
git-2.47.0-build/git-2.47.0/combine-diff.c:1085:38: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*elem.path, 0)’
git-2.47.0-build/git-2.47.0/git-compat-util.h:248: included_from: Included from here.
git-2.47.0-build/git-2.47.0/combine-diff.c:3: included_from: Included from here.
# 1083|   			free_filespec(df);
# 1084|   		} else if (0 <= (fd = open(elem->path, O_RDONLY))) {
# 1085|-> 			size_t len = xsize_t(st.st_size);
# 1086|   			ssize_t done;
# 1087|   			int is_file, i;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def215]
git-2.47.0-build/git-2.47.0/diagnose.c: scope_hint: In function ‘create_diagnostics_archive’
git-2.47.0-build/git-2.47.0/diagnose.c:210:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(xopen(*zip_path.buf, 577, 438), 1)’
#  208|   
#  209|   	archiver_fd = xopen(zip_path->buf, O_CREAT | O_WRONLY | O_TRUNC, 0666);
#  210|-> 	if (dup2(archiver_fd, STDOUT_FILENO) < 0) {
#  211|   		res = error_errno(_("could not redirect output"));
#  212|   		goto diagnose_cleanup;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def216]
git-2.47.0-build/git-2.47.0/diagnose.c:281:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘stdout_fd’
git-2.47.0-build/git-2.47.0/diagnose.c:3: included_from: Included from here.
git-2.47.0-build/git-2.47.0/diagnose.c:211:23: note: in expansion of macro ‘error_errno’
git-2.47.0-build/git-2.47.0/diagnose.c:211:23: note: in expansion of macro ‘error_errno’
git-2.47.0-build/git-2.47.0/compat/disk.h:5: included_from: Included from here.
git-2.47.0-build/git-2.47.0/diagnose.c:5: included_from: Included from here.
git-2.47.0-build/git-2.47.0/diagnose.c:211:23: note: in expansion of macro ‘error_errno’
#  279|   	strbuf_release(&buf);
#  280|   
#  281|-> 	return res;
#  282|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def217]
git-2.47.0-build/git-2.47.0/diff-lib.c: scope_hint: In function ‘get_stat_data’
git-2.47.0-build/git-2.47.0/diff-lib.c:318:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ce’
#  316|   {
#  317|   	const struct object_id *oid = &ce->oid;
#  318|-> 	unsigned int mode = ce->ce_mode;
#  319|   
#  320|   	if (!cached && !ce_uptodate(ce)) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def218]
git-2.47.0-build/git-2.47.0/dir.c:3907:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dir’
git-2.47.0-build/git-2.47.0/dir.c: scope_hint: In function ‘invalidate_one_component’
# 3905|   {
# 3906|   	uc->dir_invalidated++;
# 3907|-> 	ucd->valid = 0;
# 3908|   	ucd->untracked_nr = 0;
# 3909|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def219]
git-2.47.0-build/git-2.47.0/line-log.c:1: included_from: Included from here.
git-2.47.0-build/git-2.47.0/git-compat-util.h: scope_hint: In function ‘copy_array’
git-2.47.0-build/git-2.47.0/git-compat-util.h:1126:17: warning[-Wanalyzer-null-argument]: use of NULL ‘dst’ where non-null expected
git-2.47.0-build/git-2.47.0/git-compat-util.h:269: included_from: Included from here.
git-2.47.0-build/git-2.47.0/line-log.c: scope_hint: In function ‘copy_array’
git-2.47.0-build/git-2.47.0/git-compat-util.h:1121:45: note: in definition of macro ‘COPY_ARRAY’
git-2.47.0-build/git-2.47.0/line-log.c:47:9: note: in expansion of macro ‘COPY_ARRAY’
git-2.47.0-build/git-2.47.0/line-log.c:47:9: note: in expansion of macro ‘COPY_ARRAY’
git-2.47.0-build/git-2.47.0/line-log.c: scope_hint: In function ‘copy_array’
git-2.47.0-build/git-2.47.0/git-compat-util.h:1121:45: note: in definition of macro ‘COPY_ARRAY’
git-2.47.0-build/git-2.47.0/line-log.c:47:9: note: in expansion of macro ‘COPY_ARRAY’
git-2.47.0-build/git-2.47.0/git-compat-util.h:1032:13: note: in expansion of macro ‘unsigned_mult_overflows’
git-2.47.0-build/git-2.47.0/git-compat-util.h:1032:13: note: in expansion of macro ‘unsigned_mult_overflows’
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
# 1124|   {
# 1125|   	if (n)
# 1126|-> 		memcpy(dst, src, st_mult(size, n));
# 1127|   }
# 1128|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def220]
git-2.47.0-build/git-2.47.0/gpg-interface.c: scope_hint: In function ‘parse_gpg_output’
git-2.47.0-build/git-2.47.0/gpg-interface.c:268:45: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘next’
git-2.47.0-build/git-2.47.0/gpg-interface.c: scope_hint: In function ‘parse_gpg_output’
#  266|   					replace_cstring(&sigc->key, line, next);
#  267|   					/* Do we have signer information? */
#  268|-> 					if (*next && (sigcheck_gpg_status[i].flags & GPG_STATUS_UID)) {
#  269|   						line = next + 1;
#  270|   						next = strchrnul(line, '\n');

Error: GCC_ANALYZER_WARNING (CWE-476): [#def221]
git-2.47.0-build/git-2.47.0/gpg-interface.c:309:54: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘next’
git-2.47.0-build/git-2.47.0/gpg-interface.c: scope_hint: In function ‘parse_gpg_output’
#  307|   					limit = strchrnul(line, '\n');
#  308|   					for (j = 9; j > 0; j--) {
#  309|-> 						if (!*next || limit <= next)
#  310|   							break;
#  311|   						line = next + 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def222]
git-2.47.0-build/git-2.47.0/graph.c: scope_hint: In function ‘graph_output_post_merge_line’
git-2.47.0-build/git-2.47.0/graph.c:1110:46: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘parents’
# 1108|   
# 1109|   			for (j = 0; j < graph->num_parents; j++) {
# 1110|-> 				par_column = graph_find_new_column_by_commit(graph, parents->item);
# 1111|   				assert(par_column >= 0);
# 1112|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def223]
git-2.47.0-build/git-2.47.0/graph.c:1143:47: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 1141|   		}
# 1142|   
# 1143|-> 		if (col_commit == first_parent->item)
# 1144|   			parent_col = col;
# 1145|   	}

Error: GCC_ANALYZER_WARNING (CWE-457): [#def224]
git-2.47.0-build/git-2.47.0/diff.h:7: included_from: Included from here.
git-2.47.0-build/git-2.47.0/builtin/patch-id.c:4: included_from: Included from here.
git-2.47.0-build/git-2.47.0/builtin/patch-id.c: scope_hint: In function ‘get_one_patchid’
git-2.47.0-build/git-2.47.0/hash.h:233:24: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘pre_oid_str[0]’
git-2.47.0-build/git-2.47.0/builtin/patch-id.c:105:33: note: in expansion of macro ‘the_hash_algo’
git-2.47.0-build/git-2.47.0/builtin/patch-id.c: scope_hint: In function ‘get_one_patchid’
git-2.47.0-build/git-2.47.0/builtin/patch-id.c:105:33: note: in expansion of macro ‘the_hash_algo’
git-2.47.0-build/git-2.47.0/builtin/patch-id.c:105:33: note: in expansion of macro ‘the_hash_algo’
git-2.47.0-build/git-2.47.0/git-compat-util.h:254: included_from: Included from here.
/usr/include/string.h:407:15: note: argument 1 of ‘strlen’ must be a pointer to a null-terminated string
#  231|   #ifdef USE_THE_REPOSITORY_VARIABLE
#  232|   # include "repository.h"
#  233|-> # define the_hash_algo the_repository->hash_algo
#  234|   #endif
#  235|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def225]
git-2.47.0-build/git-2.47.0/loose.c: scope_hint: In function ‘write_one_object’
git-2.47.0-build/git-2.47.0/loose.c:201:9: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘open(path.buf, 1089, 438)’
git-2.47.0-build/git-2.47.0/loose.c:3: included_from: Included from here.
git-2.47.0-build/git-2.47.0/loose.c:200:9: note: in expansion of macro ‘error_errno’
git-2.47.0-build/git-2.47.0/loose.c:9: included_from: Included from here.
git-2.47.0-build/git-2.47.0/loose.c:200:9: note: in expansion of macro ‘error_errno’
#  199|   errout:
#  200|   	error_errno(_("failed to write loose object index %s"), path.buf);
#  201|-> 	close(fd);
#  202|   	rollback_lock_file(&lock);
#  203|   	strbuf_release(&buf);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def226]
git-2.47.0-build/git-2.47.0/pack-write.c: scope_hint: In function ‘write_rev_file_order’
git-2.47.0-build/git-2.47.0/pack-write.c:266:21: warning[-Wanalyzer-null-argument]: use of NULL ‘rev_name’ where non-null expected
git-2.47.0-build/git-2.47.0/pack-write.c:3: included_from: Included from here.
git-2.47.0-build/git-2.47.0/pack-write.c:229:9: note: in expansion of macro ‘ALLOC_ARRAY’
git-2.47.0-build/git-2.47.0/pack-write.c:232:9: note: in expansion of macro ‘QSORT_S’
/usr/include/features.h:511: included_from: Included from here.
/usr/include/unistd.h:25: included_from: Included from here.
git-2.47.0-build/git-2.47.0/git-compat-util.h:246: included_from: Included from here.
/usr/include/sys/stat.h:227:12: note: argument 1 of ‘stat’ must be non-null
#  264|   	} else if (flags & WRITE_REV_VERIFY) {
#  265|   		struct stat statbuf;
#  266|-> 		if (stat(rev_name, &statbuf)) {
#  267|   			if (errno == ENOENT) {
#  268|   				/* .rev files are optional */

Error: GCC_ANALYZER_WARNING: [#def227]
git-2.47.0-build/git-2.47.0/pager.c: scope_hint: In function ‘wait_for_pager’
git-2.47.0-build/git-2.47.0/pager.c:57:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
#   55|   	sigchain_pop_common();
#   56|   	unsetenv("GIT_PAGER_IN_USE");
#   57|-> 	dup2(old_fd1, 1);
#   58|   	close(old_fd1);
#   59|   	old_fd1 = -1;

Error: GCC_ANALYZER_WARNING: [#def228]
git-2.47.0-build/git-2.47.0/pager.c:61:17: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘2’
#   59|   	old_fd1 = -1;
#   60|   	if (old_fd2 != -1) {
#   61|-> 		dup2(old_fd2, 2);
#   62|   		close(old_fd2);
#   63|   		old_fd2 = -1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def229]
git-2.47.0-build/git-2.47.0/range-diff.c: scope_hint: In function ‘output’
git-2.47.0-build/git-2.47.0/range-diff.c:528:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘a_util’
#  526|   
#  527|   		/* Skip all the already-shown commits from the LHS. */
#  528|-> 		while (i < a->nr && a_util->shown)
#  529|   			a_util = ++i < a->nr ? a->items[i].util : NULL;
#  530|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def230]
git-2.47.0-build/git-2.47.0/range-diff.c:541:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b_util’
#  539|   
#  540|   		/* Show unmatched RHS commits. */
#  541|-> 		while (j < b->nr && b_util->matching < 0) {
#  542|   			if (!range_diff_opts->left_only)
#  543|   				output_pair_header(&opts, patch_no_width,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def231]
git-2.47.0-build/git-2.47.0/range-diff.c:550:49: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b_util’
#  548|   		/* Show matching LHS/RHS pair. */
#  549|   		if (j < b->nr) {
#  550|-> 			a_util = a->items[b_util->matching].util;
#  551|   			output_pair_header(&opts, patch_no_width,
#  552|   					   &buf, &dashes, a_util, b_util);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def232]
git-2.47.0-build/git-2.47.0/git-compat-util.h:248: included_from: Included from here.
git-2.47.0-build/git-2.47.0/diff-lib.c:7: included_from: Included from here.
git-2.47.0-build/git-2.47.0/read-cache.h: scope_hint: In function ‘ce_path_match’
git-2.47.0-build/git-2.47.0/read-cache.h:42:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ce’
git-2.47.0-build/git-2.47.0/diff-lib.c:15: included_from: Included from here.
#   40|   {
#   41|   	return match_pathspec(istate, pathspec, ce->name, ce_namelen(ce), 0, seen,
#   42|-> 			      S_ISDIR(ce->ce_mode) || S_ISGITLINK(ce->ce_mode));
#   43|   }
#   44|   

Error: GCC_ANALYZER_WARNING (CWE-835): [#def233]
git-2.47.0-build/git-2.47.0/refs.c: scope_hint: In function ‘check_refname_component’
git-2.47.0-build/git-2.47.0/refs.c:199:26: warning[-Wanalyzer-infinite-loop]: infinite loop
#  197|   
#  198|   	for (cp = refname; ; cp++) {
#  199|-> 		int ch = *cp & 255;
#  200|   		unsigned char disp = refname_disposition[ch];
#  201|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def234]
git-2.47.0-build/git-2.47.0/refs/packed-backend.c: scope_hint: In function ‘write_with_updates’
git-2.47.0-build/git-2.47.0/refs/packed-backend.c:1445:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘iter’
git-2.47.0-build/git-2.47.0/refs/packed-backend.c: scope_hint: In function ‘write_with_updates’
# 1443|   			int peel_error = ref_iterator_peel(iter, &peeled);
# 1444|   
# 1445|-> 			if (write_packed_entry(out, iter->refname,
# 1446|   					       iter->oid,
# 1447|   					       peel_error ? NULL : &peeled))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def235]
git-2.47.0-build/git-2.47.0/refs/reftable-backend.c:3: included_from: Included from here.
git-2.47.0-build/git-2.47.0/refs/reftable-backend.c: scope_hint: In function ‘queue_transaction_update’
git-2.47.0-build/git-2.47.0/refs/reftable-backend.c:953:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘arg’
git-2.47.0-build/git-2.47.0/git-compat-util.h:1246:22: note: in definition of macro ‘ALLOC_GROW’
git-2.47.0-build/git-2.47.0/git-compat-util.h:1246:22: note: in definition of macro ‘ALLOC_GROW’
git-2.47.0-build/git-2.47.0/git-compat-util.h:1246:22: note: in definition of macro ‘ALLOC_GROW’
git-2.47.0-build/git-2.47.0/git-compat-util.h:1246:22: note: in definition of macro ‘ALLOC_GROW’
#  951|   		return ret;
#  952|   
#  953|-> 	ALLOC_GROW(arg->updates, arg->updates_nr + 1,
#  954|   		   arg->updates_alloc);
#  955|   	arg->updates[arg->updates_nr].update = update;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def236]
git-2.47.0-build/git-2.47.0/reftable/publicbasics.c: scope_hint: In function ‘reftable_calloc’
git-2.47.0-build/git-2.47.0/reftable/publicbasics.c:44:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘reftable_malloc(st_mult(nelem,  elsize))’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memset’ must be non-null
#   42|   	size_t sz = st_mult(nelem, elsize);
#   43|   	void *p = reftable_malloc(sz);
#   44|-> 	memset(p, 0, sz);
#   45|   	return p;
#   46|   }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def237]
git-2.47.0-build/git-2.47.0/remote.c: scope_hint: In function ‘query_matches_negative_refspec’
git-2.47.0-build/git-2.47.0/remote.c:973:33: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘expn_name’
#  971|   
#  972|   			if (match_name_with_pattern(key, needle, value, &expn_name))
#  973|-> 				string_list_append_nodup(&reversed, expn_name);
#  974|   		} else if (refspec->matching) {
#  975|   			/* For the special matching refspec, any query should match */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def238]
git-2.47.0-build/git-2.47.0/run-command.c: scope_hint: In function ‘child_dup2’
git-2.47.0-build/git-2.47.0/run-command.c:342:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fd,  to)’
git-2.47.0-build/git-2.47.0/run-command.c:3: included_from: Included from here.
git-2.47.0-build/git-2.47.0/run-command.c:435:14: note: in expansion of macro ‘has_dir_sep’
git-2.47.0-build/git-2.47.0/run-command.c: scope_hint: In function ‘child_dup2’
git-2.47.0-build/git-2.47.0/run-command.c:14: included_from: Included from here.
git-2.47.0-build/git-2.47.0/run-command.c:758:9: note: in expansion of macro ‘trace_argv_printf’
git-2.47.0-build/git-2.47.0/run-command.c: scope_hint: In function ‘child_dup2’
git-2.47.0-build/git-2.47.0/run-command.c:489:9: note: in expansion of macro ‘ALLOC_ARRAY’
git-2.47.0-build/git-2.47.0/git-compat-util.h:1032:13: note: in expansion of macro ‘unsigned_mult_overflows’
git-2.47.0-build/git-2.47.0/run-command.c: scope_hint: In function ‘child_dup2’
git-2.47.0-build/git-2.47.0/run-command.c:508:26: note: in definition of macro ‘CHECK_BUG’
git-2.47.0-build/git-2.47.0/run-command.c:523:9: note: in expansion of macro ‘CHECK_BUG’
git-2.47.0-build/git-2.47.0/run-command.c:508:26: note: in definition of macro ‘CHECK_BUG’
git-2.47.0-build/git-2.47.0/run-command.c:525:9: note: in expansion of macro ‘CHECK_BUG’
#  340|   static void child_dup2(int fd, int to)
#  341|   {
#  342|-> 	if (dup2(fd, to) < 0)
#  343|   		child_die(CHILD_ERR_DUP2);
#  344|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def239]
git-2.47.0-build/git-2.47.0/strbuf.c: scope_hint: In function ‘strbuf_grow’
git-2.47.0-build/git-2.47.0/strbuf.c:114:28: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
git-2.47.0-build/git-2.47.0/strbuf.c:1: included_from: Included from here.
git-2.47.0-build/git-2.47.0/git-compat-util.h:137:7: note: in definition of macro ‘unsigned_add_overflows’
git-2.47.0-build/git-2.47.0/strbuf.c:112:9: note: in expansion of macro ‘ALLOC_GROW’
#  112|   	ALLOC_GROW(sb->buf, sb->len + extra + 1, sb->alloc);
#  113|   	if (new_buf)
#  114|-> 		sb->buf[0] = '\0';
#  115|   }
#  116|   

Error: CPPCHECK_WARNING (CWE-457): [#def240]
git-2.47.0-build/git-2.47.0/t/unit-tests/clar/clar.c:384: warning[uninitvar]: Uninitialized variable: matchlen
#  382|   			continue;
#  383|   
#  384|-> 		if (exact && strlen(test[i].name) != matchlen)
#  385|   			continue;
#  386|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def241]
git-2.47.0-build/git-2.47.0/t/unit-tests/clar/clar.c: scope_hint: In function ‘clar__fail’
git-2.47.0-build/git-2.47.0/t/unit-tests/clar/clar.c:686:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘error’
git-2.47.0-build/git-2.47.0/t/unit-tests/clar/clar.c:838: included_from: Included from here.
git-2.47.0-build/git-2.47.0/t/unit-tests/clar/clar.c:92: included_from: Included from here.
git-2.47.0-build/git-2.47.0/t/unit-tests/clar/clar.h:103:28: note: in expansion of macro ‘cl_must_pass_’
git-2.47.0-build/git-2.47.0/t/unit-tests/clar/clar/sandbox.h:83:9: note: in expansion of macro ‘cl_must_pass’
git-2.47.0-build/git-2.47.0/t/unit-tests/clar/clar.c: scope_hint: In function ‘clar__fail’
#  684|   	_clar.last_report->last_error = error;
#  685|   
#  686|-> 	error->file = file;
#  687|   	error->function = function;
#  688|   	error->line_number = line;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def242]
git-2.47.0-build/git-2.47.0/tempfile.c: scope_hint: In function ‘fdopen_tempfile’
git-2.47.0-build/git-2.47.0/tempfile.c:272:24: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopen(*tempfile.fd,  mode)’
#  270|   
#  271|   	tempfile->fp = fdopen(tempfile->fd, mode);
#  272|-> 	return tempfile->fp;
#  273|   }
#  274|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def243]
git-2.47.0-build/git-2.47.0/tempfile.c: scope_hint: In function ‘reopen_tempfile’
git-2.47.0-build/git-2.47.0/tempfile.c:331:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*tempfile.filename.buf, 513)’
#  329|   		BUG("reopen_tempfile called for an open object");
#  330|   	tempfile->fd = open(tempfile->filename.buf, O_WRONLY|O_TRUNC);
#  331|-> 	return tempfile->fd;
#  332|   }
#  333|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def244]
git-2.47.0-build/git-2.47.0/tree.h:4: included_from: Included from here.
git-2.47.0-build/git-2.47.0/unpack-trees.c:13: included_from: Included from here.
git-2.47.0-build/git-2.47.0/unpack-trees.c: scope_hint: In function ‘verify_clean_subdirectory’
git-2.47.0-build/git-2.47.0/unpack-trees.c:2323:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ce’
git-2.47.0-build/git-2.47.0/object.h:121:28: note: in definition of macro ‘S_ISGITLINK’
git-2.47.0-build/git-2.47.0/unpack-trees.h:5: included_from: Included from here.
git-2.47.0-build/git-2.47.0/unpack-trees.c:16: included_from: Included from here.
git-2.47.0-build/git-2.47.0/unpack-trees.c:2487:44: note: in expansion of macro ‘ce_namelen’
git-2.47.0-build/git-2.47.0/object.h:121:28: note: in definition of macro ‘S_ISGITLINK’
# 2321|   	int cnt = 0;
# 2322|   
# 2323|-> 	if (S_ISGITLINK(ce->ce_mode)) {
# 2324|   		struct object_id oid;
# 2325|   		int sub_head = repo_resolve_gitlink_ref(the_repository, ce->name,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def245]
git-2.47.0-build/git-2.47.0/utf8.c: scope_hint: In function ‘pick_one_utf8_char’
git-2.47.0-build/git-2.47.0/utf8.c:135:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘s’
git-2.47.0-build/git-2.47.0/git-compat-util.h:1290: included_from: Included from here.
git-2.47.0-build/git-2.47.0/utf8.c:1: included_from: Included from here.
git-2.47.0-build/git-2.47.0/utf8.c:749:21: note: in expansion of macro ‘tolower’
git-2.47.0-build/git-2.47.0/utf8.c:749:21: note: in expansion of macro ‘tolower’
#  133|   	if (remainder < 1) {
#  134|   		goto invalid;
#  135|-> 	} else if (*s < 0x80) {
#  136|   		/* 0xxxxxxx */
#  137|   		ch = *s;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def246]
git-2.47.0-build/git-2.47.0/builtin/fast-export.c:24: included_from: Included from here.
git-2.47.0-build/git-2.47.0/utf8.h: scope_hint: In function ‘reencode_string’
git-2.47.0-build/git-2.47.0/utf8.h:46:16: warning[-Wanalyzer-null-argument]: use of NULL ‘in’ where non-null expected
git-2.47.0-build/git-2.47.0/builtin/fast-export.c: scope_hint: In function ‘reencode_string’
<built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null
#   44|   				    const char *in_encoding)
#   45|   {
#   46|-> 	return reencode_string_len(in, strlen(in),
#   47|   				   out_encoding, in_encoding,
#   48|   				   NULL);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def247]
git-2.47.0-build/git-2.47.0/worktree.c: scope_hint: In function ‘should_prune_worktree’
git-2.47.0-build/git-2.47.0/worktree.c:761:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(git_path("worktrees/%s/gitdir", id), 0)’
#  759|   		return 1;
#  760|   	}
#  761|-> 	len = xsize_t(st.st_size);
#  762|   	path = xmallocz(len);
#  763|   

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-76.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namegit-2.47.0-1.fc42
store-results-to/tmp/tmplg_xyof2/git-2.47.0-1.fc42.tar.xz
time-created2024-11-13 00:01:01
time-finished2024-11-13 00:08:50
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmplg_xyof2/git-2.47.0-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmplg_xyof2/git-2.47.0-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9