git-2.49.0-2.fc43

List of Findings

Error: SHELLCHECK_WARNING (CWE-569): [#def1]
/usr/bin/gitk:16:19: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it.
#   14|   ## Enabling platform-specific code paths
#   15|   
#   16|-> proc is_MacOSX {} {
#   17|   	if {[tk windowingsystem] eq {aqua}} {
#   18|   		return 1

Error: SHELLCHECK_WARNING (CWE-569): [#def2]
/usr/bin/gitk:17:6: error[SC1035]: You need a space after the [ and before the ].
#   15|   
#   16|   proc is_MacOSX {} {
#   17|-> 	if {[tk windowingsystem] eq {aqua}} {
#   18|   		return 1
#   19|   	}

Error: SHELLCHECK_WARNING: [#def3]
/usr/bin/gitk:17:6: error[SC1054]: You need a space after the '{'.
#   15|   
#   16|   proc is_MacOSX {} {
#   17|-> 	if {[tk windowingsystem] eq {aqua}} {
#   18|   		return 1
#   19|   	}

Error: SHELLCHECK_WARNING (CWE-398): [#def4]
/usr/bin/gitk:17:6: error[SC1073]: Couldn't parse this test expression. Fix to allow more checks.
#   15|   
#   16|   proc is_MacOSX {} {
#   17|-> 	if {[tk windowingsystem] eq {aqua}} {
#   18|   		return 1
#   19|   	}

Error: SHELLCHECK_WARNING (CWE-398): [#def5]
/usr/bin/gitk:17:10: error[SC1072]: Expected test to end here (don't wrap commands in []/[[]]). Fix any mentioned problems and try again.
#   15|   
#   16|   proc is_MacOSX {} {
#   17|-> 	if {[tk windowingsystem] eq {aqua}} {
#   18|   		return 1
#   19|   	}

Error: SHELLCHECK_WARNING (CWE-563): [#def6]
/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): [#def7]
/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): [#def8]
/usr/libexec/git-core/git-difftool--helper:86:2: warning[SC2034]: LOCAL appears unused. Verify use (or export if used externally).
#   84|   if test -n "$GIT_DIFFTOOL_DIRDIFF"
#   85|   then
#   86|-> 	LOCAL="$1"
#   87|   	REMOTE="$2"
#   88|   	initialize_merge_tool "$merge_tool" || exit 1

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

Error: SHELLCHECK_WARNING (CWE-563): [#def10]
/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): [#def11]
/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): [#def12]
/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): [#def13]
/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): [#def14]
/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): [#def15]
/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): [#def16]
/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): [#def17]
/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): [#def18]
/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): [#def19]
/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): [#def20]
/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 'wish8' "$argv0" -- "$@"
#   11|   
#   12|   set appvers {0.21.GITGUI}

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

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

Error: SHELLCHECK_WARNING (CWE-456): [#def24]
/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.GITGUI}
#   13|-> set copyright [string map [list (c) \u00a9] {
#   14|   Copyright (c) 2006-2010 Shawn Pearce, et. al.
#   15|   

Error: SHELLCHECK_WARNING (CWE-398): [#def25]
/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.GITGUI}
#   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[SC1088]: Parsing stopped here. Invalid use of parentheses?
#   11|   
#   12|   set appvers {0.21.GITGUI}
#   13|-> set copyright [string map [list (c) \u00a9] {
#   14|   Copyright (c) 2006-2010 Shawn Pearce, et. al.
#   15|   

Error: SHELLCHECK_WARNING: [#def27]
/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): [#def28]
/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: [#def29]
/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): [#def30]
/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): [#def31]
/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: [#def32]
/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): [#def33]
/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): [#def34]
/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): [#def35]
/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): [#def36]
/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): [#def37]
/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): [#def38]
/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): [#def39]
/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): [#def40]
/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): [#def41]
/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): [#def42]
/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): [#def43]
/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): [#def44]
/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): [#def45]
/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): [#def46]
/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): [#def47]
/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): [#def48]
/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): [#def49]
/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): [#def50]
/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): [#def51]
/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): [#def52]
/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): [#def53]
/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): [#def54]
/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): [#def55]
/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): [#def56]
/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): [#def57]
/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): [#def58]
/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): [#def59]
/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): [#def60]
/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): [#def61]
/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): [#def62]
/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): [#def63]
/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): [#def64]
/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): [#def65]
/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): [#def66]
/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): [#def67]
/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): [#def68]
/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): [#def69]
/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): [#def70]
/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): [#def71]
/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): [#def72]
/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): [#def73]
/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): [#def74]
/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): [#def75]
/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): [#def76]
/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): [#def77]
/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): [#def78]
/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): [#def79]
/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-685): [#def80]
/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: [#def81]
/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: [#def82]
/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: [#def83]
/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: [#def84]
/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): [#def85]
/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): [#def86]
/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: [#def87]
/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: [#def88]
/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: [#def89]
/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: [#def90]
/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): [#def91]
/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): [#def92]
/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): [#def93]
/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): [#def94]
/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): [#def95]
/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): [#def96]
/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): [#def97]
/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): [#def98]
/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): [#def99]
/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: [#def100]
/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: [#def101]
/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): [#def102]
/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): [#def103]
/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): [#def104]
/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): [#def105]
/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): [#def106]
/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): [#def107]
/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): [#def108]
/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): [#def109]
/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): [#def110]
/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): [#def111]
/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): [#def112]
/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): [#def113]
/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): [#def114]
/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): [#def115]
/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): [#def116]
/usr/share/doc/git/contrib/completion/git-completion.bash:3043:8: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 3041|   		get-url set-url show prune update
# 3042|   		"
# 3043|-> 	local subcommand="$(__git_find_on_cmdline "$subcommands")"
# 3044|   	if [ -z "$subcommand" ]; then
# 3045|   		case "$cur" in

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

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

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

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

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

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

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

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

Error: SHELLCHECK_WARNING (CWE-758): [#def125]
/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): [#def126]
/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): [#def127]
/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): [#def128]
/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): [#def129]
/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): [#def130]
/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): [#def131]
/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): [#def132]
/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): [#def133]
/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): [#def134]
/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): [#def135]
/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): [#def136]
/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): [#def137]
/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): [#def138]
/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): [#def139]
/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): [#def140]
/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): [#def141]
/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): [#def142]
/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): [#def143]
/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): [#def144]
/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): [#def145]
/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): [#def146]
/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): [#def147]
/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): [#def148]
/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): [#def149]
/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): [#def150]
/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): [#def151]
/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): [#def152]
/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): [#def153]
/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): [#def154]
/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): [#def155]
/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): [#def156]
/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): [#def157]
/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): [#def158]
/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): [#def159]
/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): [#def160]
/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): [#def161]
/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): [#def162]
/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): [#def163]
/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 (CWE-252): [#def164]
/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): [#def165]
/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): [#def166]
/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): [#def167]
/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): [#def168]
/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): [#def169]
/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): [#def170]
/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): [#def171]
/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): [#def172]
/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): [#def173]
/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): [#def174]
/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): [#def175]
/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): [#def176]
/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): [#def177]
/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): [#def178]
/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): [#def179]
/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): [#def180]
/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): [#def181]
/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): [#def182]
/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): [#def183]
/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): [#def184]
/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): [#def185]
/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): [#def186]
/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): [#def187]
/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): [#def188]
/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): [#def189]
/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): [#def190]
/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): [#def191]
/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): [#def192]
/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): [#def193]
/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): [#def194]
/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-688): [#def195]
git-2.49.0/./strbuf.h:310:9: warning[-Wanalyzer-null-argument]: use of NULL ‘s’ where non-null expected
git-2.49.0/builtin/config.c:1402:5: enter_function: entry to ‘cmd_config’
git-2.49.0/builtin/config.c:1429:12: branch_false: following ‘false’ branch...
git-2.49.0/builtin/config.c:1435:16: branch_false: ...to here
git-2.49.0/builtin/config.c:1435:16: call_function: calling ‘cmd_config_actions’ from ‘cmd_config’
#argument 1 of ‘__builtin_strlen’ must be non-null
#  308|   static inline void strbuf_addstr(struct strbuf *sb, const char *s)
#  309|   {
#  310|-> 	strbuf_add(sb, s, strlen(s));
#  311|   }
#  312|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def196]
git-2.49.0/./utf8.h:46:16: warning[-Wanalyzer-null-argument]: use of NULL ‘in’ where non-null expected
git-2.49.0/builtin/fast-export.c:1187:5: enter_function: entry to ‘cmd_fast_export’
git-2.49.0/builtin/fast-export.c:1243:12: branch_false: following ‘false’ branch (when ‘argc != 1’)...
git-2.49.0/builtin/fast-export.c:1247:9: call_function: inlined call to ‘git_config’ from ‘cmd_fast_export’
git-2.49.0/builtin/fast-export.c:1257:12: branch_false: following ‘false’ branch...
git-2.49.0/builtin/fast-export.c:1260:13: branch_false: ...to here
git-2.49.0/builtin/fast-export.c:1288:12: branch_false: following ‘false’ branch...
git-2.49.0/builtin/fast-export.c:1291:9: branch_false: ...to here
git-2.49.0/builtin/fast-export.c:1297:16: branch_true: following ‘true’ branch...
git-2.49.0/builtin/fast-export.c:1298:17: branch_true: ...to here
git-2.49.0/builtin/fast-export.c:1298:17: call_function: calling ‘handle_commit’ from ‘cmd_fast_export’
#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-476): [#def197]
git-2.49.0/add-patch.c:530:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘file_diff’
git-2.49.0/add-patch.c:1762:5: enter_function: entry to ‘run_add_p’
git-2.49.0/add-patch.c:1798:12: branch_false: following ‘false’ branch...
git-2.49.0/add-patch.c:1799:15: branch_false: ...to here
git-2.49.0/add-patch.c:1802:13: call_function: calling ‘parse_diff’ from ‘run_add_p’
#  528|   				hunk->splittable_into++;
#  529|   
#  530|-> 			ALLOC_GROW_BY(file_diff->hunk, file_diff->hunk_nr, 1,
#  531|   				   file_diff->hunk_alloc);
#  532|   			hunk = file_diff->hunk + file_diff->hunk_nr - 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def198]
git-2.49.0/add-patch.c:607:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘hunk’
git-2.49.0/add-patch.c:1762:5: enter_function: entry to ‘run_add_p’
git-2.49.0/add-patch.c:1798:12: branch_false: following ‘false’ branch...
git-2.49.0/add-patch.c:1799:15: branch_false: ...to here
git-2.49.0/add-patch.c:1802:13: call_function: calling ‘parse_diff’ from ‘run_add_p’
#  605|   
#  606|   		p = eol == pend ? pend : eol + 1;
#  607|-> 		hunk->end = p - plain->buf;
#  608|   
#  609|   		if (colored) {

Error: GCC_ANALYZER_WARNING: [#def199]
git-2.49.0/archive-tar.c:511:13: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
git-2.49.0/archive-tar.c:481:12: branch_false: following ‘false’ branch...
git-2.49.0/archive-tar.c:484:14: branch_false: ...to here
git-2.49.0/archive-tar.c:484:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
git-2.49.0/archive-tar.c:499:9: branch_false: ...to here
git-2.49.0/archive-tar.c:508:12: branch_false: following ‘false’ branch...
git-2.49.0/archive-tar.c:510:9: branch_false: ...to here
git-2.49.0/archive-tar.c:510:9: release_resource: closed here
git-2.49.0/archive-tar.c:511:13: danger: ‘1’ could be invalid
#  509|   		die_errno(_("unable to start '%s' filter"), cmd.buf);
#  510|   	close(1);
#  511|-> 	if (dup2(filter.in, 1) < 0)
#  512|   		die_errno(_("unable to redirect descriptor"));
#  513|   	close(filter.in);

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def200]
git-2.49.0/archive-tar.c:517:9: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘1’
git-2.49.0/archive-tar.c:473:12: enter_function: entry to ‘write_tar_filter_archive’
git-2.49.0/archive-tar.c:481:12: branch_false: following ‘false’ branch...
git-2.49.0/archive-tar.c:484:14: branch_false: ...to here
git-2.49.0/archive-tar.c:484:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
git-2.49.0/archive-tar.c:499:9: branch_false: ...to here
git-2.49.0/archive-tar.c:508:12: branch_false: following ‘false’ branch...
git-2.49.0/archive-tar.c:510:9: branch_false: ...to here
git-2.49.0/archive-tar.c:510:9: release_resource: first ‘close’ here
git-2.49.0/archive-tar.c:511:12: branch_false: following ‘false’ branch...
git-2.49.0/archive-tar.c:513:9: branch_false: ...to here
git-2.49.0/archive-tar.c:515:13: call_function: calling ‘write_tar_archive’ from ‘write_tar_filter_archive’
git-2.49.0/archive-tar.c:515:13: return_function: returning to ‘write_tar_filter_archive’ from ‘write_tar_archive’
git-2.49.0/archive-tar.c:517:9: danger: second ‘close’ here; first ‘close’ was at [(8)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/7)
#  515|   	r = write_tar_archive(ar, args);
#  516|   
#  517|-> 	close(1);
#  518|   	if (finish_command(&filter) != 0)
#  519|   		die(_("'%s' filter reported error"), cmd.buf);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def201]
git-2.49.0/blame.c:2842:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘c’
git-2.49.0/blame.c:2764:6: enter_function: entry to ‘setup_scoreboard’
git-2.49.0/blame.c:2777:12: branch_false: following ‘false’ branch...
git-2.49.0/blame.c:2780:12: branch_false: ...to here
git-2.49.0/blame.c:2781:29: call_function: calling ‘find_single_final’ from ‘setup_scoreboard’
git-2.49.0/blame.c:2781:29: return_function: returning to ‘setup_scoreboard’ from ‘find_single_final’
git-2.49.0/blame.c:2781:17: release_memory: ‘*sb.final’ is NULL
git-2.49.0/blame.c:2788:12: branch_true: following ‘true’ branch...
git-2.49.0/blame.c:2791:12: branch_false: following ‘false’ branch...
git-2.49.0/blame.c:2835:12: branch_false: following ‘false’ branch...
git-2.49.0/blame.c:2838:13: branch_false: ...to here
git-2.49.0/blame.c:2838:12: branch_true: following ‘true’ branch...
git-2.49.0/blame.c:2842:24: danger: dereference of NULL ‘c’
# 2840|   
# 2841|   		sb->revs->children.name = "children";
# 2842|-> 		while (c->parents &&
# 2843|   		       !oideq(&c->object.oid, &sb->final->object.oid)) {
# 2844|   			struct commit_list *l = xcalloc(1, sizeof(*l));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def202]
git-2.49.0/builtin/archive.c:16:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(xopen(output_file, 577, 438), 1)’
git-2.49.0/builtin/archive.c:15:12: branch_true: following ‘true’ branch...
git-2.49.0/builtin/archive.c:16:21: branch_true: ...to here
git-2.49.0/builtin/archive.c:16:21: acquire_resource: opened here
git-2.49.0/builtin/archive.c:16:20: danger: ‘dup2(xopen(output_file, 577, 438), 1)’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   14|   	int output_fd = xopen(output_file, O_CREAT | O_WRONLY | O_TRUNC, 0666);
#   15|   	if (output_fd != 1) {
#   16|-> 		if (dup2(output_fd, 1) < 0)
#   17|   			die_errno(_("could not redirect output"));
#   18|   		else

Error: GCC_ANALYZER_WARNING (CWE-457): [#def203]
git-2.49.0/builtin/cat-file.c:158:36: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘type’
git-2.49.0/builtin/cat-file.c:930:5: enter_function: entry to ‘cmd_cat_file’
git-2.49.0/builtin/cat-file.c:1061:12: branch_false: following ‘false’ branch...
git-2.49.0/builtin/cat-file.c:1074:13: branch_false: ...to here
git-2.49.0/builtin/cat-file.c:1074:12: branch_true: following ‘true’ branch...
git-2.49.0/builtin/cat-file.c:1075:20: branch_true: ...to here
git-2.49.0/builtin/cat-file.c:1081:25: branch_false: following ‘false’ branch...
git-2.49.0/builtin/cat-file.c:1084:25: branch_false: ...to here
git-2.49.0/builtin/cat-file.c:1084:25: branch_true: following ‘true’ branch...
git-2.49.0/builtin/cat-file.c:1085:25: branch_true: ...to here
git-2.49.0/builtin/cat-file.c:1100:16: call_function: calling ‘cat_one_file’ from ‘cmd_cat_file’
#  156|   			die("git cat-file: could not get object info");
#  157|   
#  158|-> 		if (use_mailmap && (type == OBJ_COMMIT || type == OBJ_TAG)) {
#  159|   			size_t s = size;
#  160|   			buf = replace_idents_using_mailmap(buf, &s);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def204]
git-2.49.0/builtin/clone.c:1096:26: warning[-Wanalyzer-null-argument]: use of NULL ‘work_tree’ where non-null expected
git-2.49.0/builtin/clone.c:860:5: enter_function: entry to ‘cmd_clone’
git-2.49.0/builtin/clone.c:894:21: release_memory: ‘real_git_dir’ is NULL
git-2.49.0/builtin/clone.c:895:21: release_memory: ‘real_git_dir’ is NULL
git-2.49.0/builtin/clone.c:904:21: release_memory: ‘real_git_dir’ is NULL
git-2.49.0/builtin/clone.c:986:28: release_memory: ‘real_git_dir’ is NULL
git-2.49.0/builtin/clone.c:998:12: branch_false: following ‘false’ branch...
git-2.49.0/builtin/clone.c:1002:12: branch_false: ...to here
git-2.49.0/builtin/clone.c:1002:12: branch_false: following ‘false’ branch...
git-2.49.0/builtin/clone.c:1006:13: branch_false: ...to here
git-2.49.0/builtin/clone.c:1035:16: call_function: calling ‘get_repo_path’ from ‘cmd_clone’
git-2.49.0/builtin/clone.c:1035:16: return_function: returning to ‘cmd_clone’ from ‘get_repo_path’
git-2.49.0/builtin/clone.c:1036:12: branch_false: following ‘false’ branch...
git-2.49.0/builtin/clone.c:1039:20: branch_false: ...to here
git-2.49.0/builtin/clone.c:1039:19: branch_true: following ‘true’ branch...
git-2.49.0/builtin/clone.c:1041:32: branch_true: ...to here
git-2.49.0/builtin/clone.c:1080:12: branch_true: following ‘true’ branch...
git-2.49.0/builtin/clone.c:1081:27: branch_true: ...to here
git-2.49.0/builtin/clone.c:1090:12: branch_true: following ‘true’ branch...
git-2.49.0/builtin/clone.c:1091:21: branch_true: ...to here
git-2.49.0/builtin/clone.c:1091:20: branch_false: following ‘false’ branch...
git-2.49.0/builtin/clone.c:1094:20: branch_false: ...to here
git-2.49.0/builtin/clone.c:1094:20: branch_false: following ‘false’ branch...
git-2.49.0/builtin/clone.c:1096:26: branch_false: ...to here
git-2.49.0/builtin/clone.c:1096:26: danger: argument 1 (‘work_tree’) NULL where non-null expected
# 1094|   		if (dest_exists)
# 1095|   			junk_work_tree_flags |= REMOVE_DIR_KEEP_TOPLEVEL;
# 1096|-> 		else if (mkdir(work_tree, 0777))
# 1097|   			die_errno(_("could not create work tree dir '%s'"),
# 1098|   				  work_tree);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def205]
git-2.49.0/builtin/interpret-trailers.c:104:13: warning[-Wanalyzer-null-argument]: use of NULL ‘file’ where non-null expected
git-2.49.0/builtin/interpret-trailers.c:193:5: enter_function: entry to ‘cmd_interpret_trailers’
git-2.49.0/builtin/interpret-trailers.c:234:12: branch_false: following ‘false’ branch...
git-2.49.0/builtin/interpret-trailers.c:239:21: branch_false: ...to here
git-2.49.0/builtin/interpret-trailers.c:239:20: branch_false: following ‘false’ branch...
git-2.49.0/builtin/interpret-trailers.c:241:17: branch_false: ...to here
git-2.49.0/builtin/interpret-trailers.c:241:17: call_function: calling ‘interpret_trailers’ from ‘cmd_interpret_trailers’
#  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): [#def206]
git-2.49.0/builtin/name-rev.c:226:46: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
git-2.49.0/builtin/name-rev.c:563:5: enter_function: entry to ‘cmd_name_rev’
git-2.49.0/builtin/name-rev.c:607:12: branch_false: following ‘false’ branch...
git-2.49.0/builtin/name-rev.c:611:12: branch_false: ...to here
git-2.49.0/builtin/name-rev.c:657:9: call_function: calling ‘name_tips’ from ‘cmd_name_rev’
#  224|   				distance = name->distance + MERGE_TRAVERSAL_WEIGHT;
#  225|   			} else {
#  226|-> 				generation = name->generation + 1;
#  227|   				distance = name->distance + 1;
#  228|   			}

Error: GCC_ANALYZER_WARNING (CWE-457): [#def207]
git-2.49.0/builtin/patch-id.c:107:33: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘pre_oid_str[0]’
git-2.49.0/builtin/patch-id.c:179:13: enter_function: entry to ‘generate_id_list’
git-2.49.0/builtin/patch-id.c:185:9: call_function: calling ‘oidclr’ from ‘generate_id_list’
git-2.49.0/builtin/patch-id.c:185:9: return_function: returning to ‘generate_id_list’ from ‘oidclr’
git-2.49.0/builtin/patch-id.c:186:16: branch_true: following ‘true’ branch...
git-2.49.0/builtin/patch-id.c:187:28: branch_true: ...to here
git-2.49.0/builtin/patch-id.c:187:28: call_function: calling ‘get_one_patchid’ from ‘generate_id_list’
#  105|   				diff_is_binary = 1;
#  106|   				before = 0;
#  107|-> 				git_hash_update(&ctx, pre_oid_str,
#  108|   						strlen(pre_oid_str));
#  109|   				git_hash_update(&ctx, post_oid_str,

Error: GCC_ANALYZER_WARNING (CWE-688): [#def208]
git-2.49.0/builtin/pull.c:755:22: warning[-Wanalyzer-null-argument]: use of NULL ‘remote’ where non-null expected
git-2.49.0/builtin/pull.c:981:5: enter_function: entry to ‘cmd_pull’
git-2.49.0/builtin/pull.c:1016:9: call_function: inlined call to ‘parse_repo_refspecs’ from ‘cmd_pull’
git-2.49.0/builtin/pull.c:1018:13: branch_false: ...to here
git-2.49.0/builtin/pull.c:1040:12: branch_false: following ‘false’ branch...
git-2.49.0/builtin/pull.c:1043:13: branch_false: ...to here
git-2.49.0/builtin/pull.c:1043:12: branch_false: following ‘false’ branch...
git-2.49.0/builtin/pull.c:1046:13: branch_false: ...to here
git-2.49.0/builtin/pull.c:1049:12: branch_true: following ‘true’ branch...
git-2.49.0/builtin/pull.c:1050:21: branch_true: ...to here
git-2.49.0/builtin/pull.c:1061:21: call_function: calling ‘get_rebase_fork_point’ from ‘cmd_pull’
#  753|   
#  754|   	if (*spec_src) {
#  755|-> 		if (!strcmp(remote, "."))
#  756|   			merge_branch = mkpath("refs/heads/%s", spec_src);
#  757|   		else

Error: GCC_ANALYZER_WARNING (CWE-688): [#def209]
git-2.49.0/builtin/sparse-checkout.c:1048:17: warning[-Wanalyzer-null-argument]: use of NULL ‘xfopen(check_rules_opts.rules_file, "r")’ where non-null expected
git-2.49.0/builtin/sparse-checkout.c:1017:12: enter_function: entry to ‘sparse_checkout_check_rules’
git-2.49.0/builtin/sparse-checkout.c:1045:12: branch_true: following ‘true’ branch...
git-2.49.0/builtin/sparse-checkout.c:1046:22: branch_true: ...to here
git-2.49.0/builtin/sparse-checkout.c:1047:17: call_function: calling ‘add_patterns_from_input’ from ‘sparse_checkout_check_rules’
git-2.49.0/builtin/sparse-checkout.c:1047:17: return_function: returning to ‘sparse_checkout_check_rules’ from ‘add_patterns_from_input’
git-2.49.0/builtin/sparse-checkout.c:1048:17: danger: argument 1 (‘xfopen(check_rules_opts.rules_file, "r")’) NULL where non-null expected
# 1046|   		fp = xfopen(check_rules_opts.rules_file, "r");
# 1047|   		add_patterns_from_input(&pl, argc, argv, fp);
# 1048|-> 		fclose(fp);
# 1049|   	} else {
# 1050|   		sparse_filename = get_sparse_checkout_filename();

Error: GCC_ANALYZER_WARNING (CWE-457): [#def210]
git-2.49.0/builtin/submodule--helper.c:98:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘default_remote’
git-2.49.0/builtin/submodule--helper.c:3038:12: enter_function: entry to ‘module_set_url’
git-2.49.0/builtin/submodule--helper.c:3057:12: branch_false: following ‘false’ branch...
git-2.49.0/builtin/submodule--helper.c:3062:12: branch_false: following ‘false’ branch...
git-2.49.0/builtin/submodule--helper.c:3066:51: branch_false: ...to here
git-2.49.0/builtin/submodule--helper.c:3069:12: branch_true: following ‘true’ branch...
git-2.49.0/builtin/submodule--helper.c:3070:17: branch_true: ...to here
git-2.49.0/builtin/submodule--helper.c:3071:17: call_function: calling ‘sync_submodule’ from ‘module_set_url’
#   96|   		exit(code);
#   97|   
#   98|-> 	return default_remote;
#   99|   }
#  100|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def211]
git-2.49.0/builtin/submodule--helper.c:1301:22: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘default_remote’
git-2.49.0/builtin/submodule--helper.c:3038:12: enter_function: entry to ‘module_set_url’
git-2.49.0/builtin/submodule--helper.c:3057:12: branch_false: following ‘false’ branch...
git-2.49.0/builtin/submodule--helper.c:3062:12: branch_false: following ‘false’ branch...
git-2.49.0/builtin/submodule--helper.c:3066:51: branch_false: ...to here
git-2.49.0/builtin/submodule--helper.c:3069:12: branch_true: following ‘true’ branch...
git-2.49.0/builtin/submodule--helper.c:3070:17: branch_true: ...to here
git-2.49.0/builtin/submodule--helper.c:3071:17: call_function: calling ‘sync_submodule’ from ‘module_set_url’
# 1299|   		exit(code);
# 1300|   
# 1301|-> 	remote_key = xstrfmt("remote.%s.url", default_remote);
# 1302|   	free(default_remote);
# 1303|   

Error: GCC_ANALYZER_WARNING: [#def212]
git-2.49.0/column.c:395:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
git-2.49.0/column.c:370:12: branch_false: following ‘false’ branch...
git-2.49.0/column.c:373:9: branch_false: ...to here
git-2.49.0/column.c:390:12: branch_false: following ‘false’ branch...
git-2.49.0/column.c:393:18: branch_false: ...to here
git-2.49.0/column.c:394:9: release_resource: closed here
git-2.49.0/column.c:395:9: danger: ‘1’ could be invalid
#  393|   	fd_out = dup(1);
#  394|   	close(1);
#  395|-> 	dup2(column_process.in, 1);
#  396|   	close(column_process.in);
#  397|   	return 0;

Error: GCC_ANALYZER_WARNING: [#def213]
git-2.49.0/column.c:408:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
git-2.49.0/column.c:402:12: branch_false: following ‘false’ branch...
git-2.49.0/column.c:405:9: branch_false: ...to here
git-2.49.0/column.c:406:9: release_resource: closed here
git-2.49.0/column.c:408:9: danger: ‘1’ could be invalid
#  406|   	close(1);
#  407|   	finish_command(&column_process);
#  408|-> 	dup2(fd_out, 1);
#  409|   	close(fd_out);
#  410|   	fd_out = -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def214]
git-2.49.0/combine-diff.c:1073:46: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*elem.path, 0)’
git-2.49.0/combine-diff.c:1282:6: enter_function: entry to ‘show_combined_diff’
git-2.49.0/combine-diff.c:1288:12: branch_false: following ‘false’ branch...
git-2.49.0/combine-diff.c:1292:18: branch_false: ...to here
git-2.49.0/combine-diff.c:1292:17: branch_true: following ‘true’ branch...
git-2.49.0/combine-diff.c:1293:17: branch_true: ...to here
git-2.49.0/combine-diff.c:1293:17: call_function: calling ‘show_patch_diff’ from ‘show_combined_diff’
# 1071|   			free_filespec(df);
# 1072|   		} else if (0 <= (fd = open(elem->path, O_RDONLY))) {
# 1073|-> 			size_t len = xsize_t(st.st_size);
# 1074|   			ssize_t done;
# 1075|   			int is_file, i;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def215]
git-2.49.0/diagnose.c:210:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(xopen(*zip_path.buf, 577, 438), 1)’
git-2.49.0/diagnose.c:198:12: branch_false: following ‘false’ branch (when ‘mode != 0’)...
git-2.49.0/diagnose.c:203:21: branch_false: ...to here
git-2.49.0/diagnose.c:204:12: branch_false: following ‘false’ branch (when ‘stdout_fd >= 0’)...
git-2.49.0/diagnose.c:209:29: branch_false: ...to here
git-2.49.0/diagnose.c:210:13: acquire_resource: opened here
git-2.49.0/diagnose.c:210:12: danger: ‘dup2(xopen(*zip_path.buf, 577, 438), 1)’ leaks here; was opened at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  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.49.0/diagnose.c:281:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘stdout_fd’
git-2.49.0/diagnose.c:181:5: enter_function: entry to ‘create_diagnostics_archive’
git-2.49.0/diagnose.c:198:12: branch_false: following ‘false’ branch (when ‘mode != 0’)...
git-2.49.0/diagnose.c:203:21: branch_false: ...to here
git-2.49.0/diagnose.c:203:21: acquire_resource: opened here
git-2.49.0/diagnose.c:204:12: branch_false: following ‘false’ branch (when ‘stdout_fd >= 0’)...
git-2.49.0/diagnose.c:209:29: branch_false: ...to here
git-2.49.0/diagnose.c:210:12: branch_true: following ‘true’ branch...
git-2.49.0/diagnose.c:211:23: branch_true: ...to here
git-2.49.0/diagnose.c:211:23: call_function: calling ‘_’ from ‘create_diagnostics_archive’
git-2.49.0/diagnose.c:211:23: return_function: returning to ‘create_diagnostics_archive’ from ‘_’
git-2.49.0/diagnose.c:272:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
git-2.49.0/diagnose.c:281:16: danger: ‘stdout_fd’ leaks here; was opened at [(4)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/3)
#  279|   	strbuf_release(&buf);
#  280|   
#  281|-> 	return res;
#  282|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def217]
git-2.49.0/diff-lib.c:313:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ce’
git-2.49.0/diff-lib.c:434:13: enter_function: entry to ‘do_oneway_diff’
git-2.49.0/diff-lib.c:445:12: branch_true: following ‘true’ branch...
git-2.49.0/diff-lib.c:446:13: branch_true: ...to here
git-2.49.0/diff-lib.c:445:13: branch_true: following ‘true’ branch...
git-2.49.0/diff-lib.c:445:13: branch_true: ...to here
git-2.49.0/diff-lib.c:445:13: branch_false: following ‘false’ branch (when ‘idx’ is NULL)...
git-2.49.0/diff-lib.c:454:18: branch_false: ...to here
git-2.49.0/diff-lib.c:454:18: branch_true: following ‘true’ branch...
 branch_true: ...to here
git-2.49.0/diff-lib.c:459:12: branch_false: following ‘false’ branch...
git-2.49.0/diff-lib.c:471:12: branch_false: ...to here
git-2.49.0/diff-lib.c:471:12: branch_true: following ‘true’ branch (when ‘tree’ is NULL)...
git-2.49.0/diff-lib.c:472:17: branch_true: ...to here
git-2.49.0/diff-lib.c:472:17: call_function: calling ‘show_new_file’ from ‘do_oneway_diff’
#  311|   {
#  312|   	const struct object_id *oid = &ce->oid;
#  313|-> 	unsigned int mode = ce->ce_mode;
#  314|   
#  315|   	if (!cached && !ce_uptodate(ce)) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def218]
git-2.49.0/dir.c:3910:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ucd’
git-2.49.0/dir.c:3940:12: enter_function: entry to ‘invalidate_one_component’
git-2.49.0/dir.c:3946:12: branch_true: following ‘true’ branch (when ‘rest’ is non-NULL)...
git-2.49.0/dir.c:3947:37: branch_true: ...to here
git-2.49.0/dir.c:3949:25: call_function: calling ‘lookup_untracked’ from ‘invalidate_one_component’
git-2.49.0/dir.c:3949:25: return_function: returning to ‘invalidate_one_component’ from ‘lookup_untracked’
git-2.49.0/dir.c:3951:25: call_function: calling ‘invalidate_one_component’ from ‘invalidate_one_component’
# 3908|   {
# 3909|   	uc->dir_invalidated++;
# 3910|-> 	ucd->valid = 0;
# 3911|   	for (size_t i = 0; i < ucd->untracked_nr; i++)
# 3912|   		free(ucd->untracked[i]);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def219]
git-2.49.0/gpg-interface.c:266:45: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘next’
git-2.49.0/gpg-interface.c:224:13: enter_function: entry to ‘parse_gpg_output’
git-2.49.0/gpg-interface.c:232:26: branch_true: following ‘true’ branch...
 branch_true: ...to here
git-2.49.0/gpg-interface.c:235:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
git-2.49.0/gpg-interface.c:239:22: call_function: inlined call to ‘skip_prefix’ from ‘parse_gpg_output’
git-2.49.0/gpg-interface.c:239:20: branch_true: following ‘true’ branch...
 branch_true: ...to here
git-2.49.0/gpg-interface.c:243:36: branch_true: following ‘true’ branch (when ‘i != 8’)...
git-2.49.0/gpg-interface.c:244:29: branch_true: ...to here
git-2.49.0/gpg-interface.c:244:28: branch_true: following ‘true’ branch...
git-2.49.0/gpg-interface.c:254:37: branch_true: ...to here
git-2.49.0/gpg-interface.c:262:36: branch_true: following ‘true’ branch...
git-2.49.0/gpg-interface.c:263:48: branch_true: ...to here
git-2.49.0/gpg-interface.c:264:41: call_function: calling ‘replace_cstring’ from ‘parse_gpg_output’
git-2.49.0/gpg-interface.c:264:41: return_function: returning to ‘parse_gpg_output’ from ‘replace_cstring’
git-2.49.0/gpg-interface.c:266:45: danger: dereference of NULL ‘next’
#  264|   					replace_cstring(&sigc->key, line, next);
#  265|   					/* Do we have signer information? */
#  266|-> 					if (*next && (sigcheck_gpg_status[i].flags & GPG_STATUS_UID)) {
#  267|   						line = next + 1;
#  268|   						next = strchrnul(line, '\n');

Error: GCC_ANALYZER_WARNING (CWE-476): [#def220]
git-2.49.0/gpg-interface.c:307:54: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘next’
git-2.49.0/gpg-interface.c:224:13: enter_function: entry to ‘parse_gpg_output’
git-2.49.0/gpg-interface.c:232:26: branch_true: following ‘true’ branch...
 branch_true: ...to here
git-2.49.0/gpg-interface.c:235:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
git-2.49.0/gpg-interface.c:239:22: call_function: inlined call to ‘skip_prefix’ from ‘parse_gpg_output’
git-2.49.0/gpg-interface.c:239:20: branch_true: following ‘true’ branch...
 branch_true: ...to here
git-2.49.0/gpg-interface.c:243:36: branch_true: following ‘true’ branch (when ‘i != 8’)...
git-2.49.0/gpg-interface.c:244:29: branch_true: ...to here
git-2.49.0/gpg-interface.c:244:28: branch_true: following ‘true’ branch...
git-2.49.0/gpg-interface.c:254:37: branch_true: ...to here
git-2.49.0/gpg-interface.c:262:36: branch_false: following ‘false’ branch...
 branch_false: ...to here
git-2.49.0/gpg-interface.c:274:36: branch_false: following ‘false’ branch...
git-2.49.0/gpg-interface.c:292:37: branch_false: ...to here
git-2.49.0/gpg-interface.c:292:36: branch_true: following ‘true’ branch...
git-2.49.0/gpg-interface.c:296:48: branch_true: ...to here
git-2.49.0/gpg-interface.c:297:41: call_function: calling ‘replace_cstring’ from ‘parse_gpg_output’
git-2.49.0/gpg-interface.c:297:41: return_function: returning to ‘parse_gpg_output’ from ‘replace_cstring’
git-2.49.0/gpg-interface.c:306:53: branch_true: following ‘true’ branch (when ‘j != 0’)...
git-2.49.0/gpg-interface.c:307:54: branch_true: ...to here
git-2.49.0/gpg-interface.c:307:54: danger: dereference of NULL ‘next’
#  305|   					limit = strchrnul(line, '\n');
#  306|   					for (j = 9; j > 0; j--) {
#  307|-> 						if (!*next || limit <= next)
#  308|   							break;
#  309|   						line = next + 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def221]
git-2.49.0/graph.c:1115:46: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘parents’
git-2.49.0/graph.c:1519:6: enter_function: entry to ‘graph_show_commit_msg’
git-2.49.0/graph.c:1528:9: call_function: calling ‘graph_show_strbuf’ from ‘graph_show_commit_msg’
# 1113|   
# 1114|   			for (j = 0; j < graph->num_parents; j++) {
# 1115|-> 				par_column = graph_find_new_column_by_commit(graph, parents->item);
# 1116|   				assert(par_column >= 0);
# 1117|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def222]
git-2.49.0/graph.c:1148:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
git-2.49.0/graph.c:1519:6: enter_function: entry to ‘graph_show_commit_msg’
git-2.49.0/graph.c:1528:9: call_function: calling ‘graph_show_strbuf’ from ‘graph_show_commit_msg’
# 1146|   		}
# 1147|   
# 1148|-> 		if (col_commit == first_parent->item)
# 1149|   			parent_col = col;
# 1150|   	}

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def223]
git-2.49.0/loose.c:200:9: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘open(path.buf, 1089, 438)’
git-2.49.0/loose.c:169:12: enter_function: entry to ‘write_one_object’
git-2.49.0/loose.c:181:12: branch_false: following ‘false’ branch...
git-2.49.0/loose.c:183:13: branch_false: ...to here
git-2.49.0/loose.c:183:12: branch_false: following ‘false’ branch...
git-2.49.0/loose.c:185:14: branch_false: ...to here
git-2.49.0/loose.c:189:12: branch_false: following ‘false’ branch...
git-2.49.0/loose.c:191:13: branch_false: ...to here
git-2.49.0/loose.c:191:13: release_resource: first ‘close’ here
git-2.49.0/loose.c:191:12: branch_true: following ‘true’ branch...
git-2.49.0/loose.c:192:17: branch_true: ...to here
git-2.49.0/loose.c:199:9: call_function: calling ‘_’ from ‘write_one_object’
git-2.49.0/loose.c:199:9: return_function: returning to ‘write_one_object’ from ‘_’
git-2.49.0/loose.c:200:9: danger: second ‘close’ here; first ‘close’ was at [(8)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/7)
#  198|   errout:
#  199|   	error_errno(_("failed to write loose object index %s"), path.buf);
#  200|-> 	close(fd);
#  201|   	rollback_lock_file(&lock);
#  202|   	strbuf_release(&buf);

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def224]
git-2.49.0/midx.c:222:17: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘git_open_cloexec(midx_name, 0)’
git-2.49.0/midx.c:882:5: enter_function: entry to ‘verify_midx_file’
git-2.49.0/midx.c:887:38: call_function: calling ‘load_multi_pack_index’ from ‘verify_midx_file’
#  220|   		munmap(midx_map, midx_size);
#  221|   	if (0 <= fd)
#  222|-> 		close(fd);
#  223|   	return NULL;
#  224|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def225]
git-2.49.0/pack-write.c:274:21: warning[-Wanalyzer-null-argument]: use of NULL ‘rev_name’ where non-null expected
git-2.49.0/pack-write.c:558:6: enter_function: entry to ‘stage_tmp_packfiles’
git-2.49.0/pack-write.c:571:12: branch_false: following ‘false’ branch...
git-2.49.0/pack-write.c:574:33: branch_false: ...to here
git-2.49.0/pack-write.c:574:33: call_function: calling ‘write_idx_file’ from ‘stage_tmp_packfiles’
git-2.49.0/pack-write.c:574:33: return_function: returning to ‘stage_tmp_packfiles’ from ‘write_idx_file’
git-2.49.0/pack-write.c:576:12: branch_false: following ‘false’ branch...
git-2.49.0/pack-write.c:579:24: branch_false: ...to here
git-2.49.0/pack-write.c:579:24: call_function: calling ‘write_rev_file’ from ‘stage_tmp_packfiles’
#  272|   	} else if (flags & WRITE_REV_VERIFY) {
#  273|   		struct stat statbuf;
#  274|-> 		if (stat(rev_name, &statbuf)) {
#  275|   			if (errno == ENOENT) {
#  276|   				/* .rev files are optional */

Error: GCC_ANALYZER_WARNING: [#def226]
git-2.49.0/pager.c:55:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
git-2.49.0/pager.c:47:6: enter_function: entry to ‘wait_for_pager’
git-2.49.0/pager.c:49:12: branch_false: following ‘false’ branch...
git-2.49.0/pager.c:52:9: branch_false: ...to here
git-2.49.0/pager.c:52:9: call_function: calling ‘finish_pager’ from ‘wait_for_pager’
git-2.49.0/pager.c:52:9: return_function: returning to ‘wait_for_pager’ from ‘finish_pager’
git-2.49.0/pager.c:55:9: danger: ‘1’ could be invalid
#   53|   	sigchain_pop_common();
#   54|   	unsetenv("GIT_PAGER_IN_USE");
#   55|-> 	dup2(old_fd1, 1);
#   56|   	close(old_fd1);
#   57|   	old_fd1 = -1;

Error: GCC_ANALYZER_WARNING: [#def227]
git-2.49.0/pager.c:59:17: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘2’
git-2.49.0/pager.c:47:6: enter_function: entry to ‘wait_for_pager’
git-2.49.0/pager.c:49:12: branch_false: following ‘false’ branch...
git-2.49.0/pager.c:52:9: branch_false: ...to here
git-2.49.0/pager.c:52:9: call_function: calling ‘finish_pager’ from ‘wait_for_pager’
git-2.49.0/pager.c:52:9: return_function: returning to ‘wait_for_pager’ from ‘finish_pager’
git-2.49.0/pager.c:58:12: branch_true: following ‘true’ branch...
git-2.49.0/pager.c:59:17: branch_true: ...to here
git-2.49.0/pager.c:59:17: danger: ‘2’ could be invalid
#   57|   	old_fd1 = -1;
#   58|   	if (old_fd2 != -1) {
#   59|-> 		dup2(old_fd2, 2);
#   60|   		close(old_fd2);
#   61|   		old_fd2 = -1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def228]
git-2.49.0/range-diff.c:535:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘a_util’
git-2.49.0/range-diff.c:529:16: branch_true: following ‘true’ branch...
git-2.49.0/range-diff.c:531:26: branch_true: ...to here
git-2.49.0/range-diff.c:531:26: branch_true: following ‘true’ branch...
git-2.49.0/range-diff.c:531:38: branch_true: ...to here
git-2.49.0/range-diff.c:532:26: branch_false: following ‘false’ branch...
 branch_false: ...to here
git-2.49.0/range-diff.c:535:24: branch_true: following ‘true’ branch...
git-2.49.0/range-diff.c:536:34: branch_true: following ‘true’ branch...
git-2.49.0/range-diff.c:536:48: branch_true: ...to here
git-2.49.0/range-diff.c:535:24: branch_true: following ‘true’ branch...
git-2.49.0/range-diff.c:535:37: danger: dereference of NULL ‘a_util’
#  533|   
#  534|   		/* Skip all the already-shown commits from the LHS. */
#  535|-> 		while (i < a->nr && a_util->shown)
#  536|   			a_util = ++i < a->nr ? a->items[i].util : NULL;
#  537|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def229]
git-2.49.0/range-diff.c:548:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b_util’
git-2.49.0/range-diff.c:529:16: branch_true: following ‘true’ branch...
git-2.49.0/range-diff.c:531:26: branch_true: ...to here
git-2.49.0/range-diff.c:531:26: branch_true: following ‘true’ branch...
git-2.49.0/range-diff.c:531:38: branch_true: ...to here
git-2.49.0/range-diff.c:532:26: branch_true: following ‘true’ branch...
git-2.49.0/range-diff.c:532:38: branch_true: ...to here
git-2.49.0/range-diff.c:535:24: branch_true: following ‘true’ branch...
git-2.49.0/range-diff.c:535:37: branch_true: ...to here
git-2.49.0/range-diff.c:539:20: branch_true: following ‘true’ branch...
git-2.49.0/range-diff.c:539:34: branch_true: ...to here
git-2.49.0/range-diff.c:539:21: branch_false: following ‘false’ branch...
 branch_false: ...to here
git-2.49.0/range-diff.c:548:24: branch_true: following ‘true’ branch...
git-2.49.0/range-diff.c:548:37: danger: dereference of NULL ‘b_util’
#  546|   
#  547|   		/* Show unmatched RHS commits. */
#  548|-> 		while (j < b->nr && b_util->matching < 0) {
#  549|   			if (!range_diff_opts->left_only)
#  550|   				output_pair_header(&opts, patch_no_width,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def230]
git-2.49.0/range-diff.c:557:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b_util’
git-2.49.0/range-diff.c:529:16: branch_true: following ‘true’ branch...
git-2.49.0/range-diff.c:531:26: branch_true: ...to here
git-2.49.0/range-diff.c:531:26: branch_true: following ‘true’ branch...
git-2.49.0/range-diff.c:531:38: branch_true: ...to here
git-2.49.0/range-diff.c:532:26: branch_true: following ‘true’ branch...
git-2.49.0/range-diff.c:532:38: branch_true: ...to here
git-2.49.0/range-diff.c:535:24: branch_true: following ‘true’ branch...
git-2.49.0/range-diff.c:535:37: branch_true: ...to here
git-2.49.0/range-diff.c:539:20: branch_true: following ‘true’ branch...
git-2.49.0/range-diff.c:539:34: branch_true: ...to here
git-2.49.0/range-diff.c:539:21: branch_false: following ‘false’ branch...
 branch_false: ...to here
git-2.49.0/range-diff.c:548:24: branch_true: following ‘true’ branch...
git-2.49.0/range-diff.c:548:24: branch_false: following ‘false’ branch...
git-2.49.0/range-diff.c:556:20: branch_false: ...to here
git-2.49.0/range-diff.c:556:20: branch_true: following ‘true’ branch...
git-2.49.0/range-diff.c:557:34: branch_true: ...to here
git-2.49.0/range-diff.c:557:43: danger: dereference of NULL ‘b_util’
#  555|   		/* Show matching LHS/RHS pair. */
#  556|   		if (j < b->nr) {
#  557|-> 			a_util = a->items[b_util->matching].util;
#  558|   			output_pair_header(&opts, patch_no_width,
#  559|   					   &buf, &dashes, a_util, b_util);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def231]
git-2.49.0/read-cache.h:42:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ce’
git-2.49.0/diff-lib.c:509:12: enter_function: entry to ‘oneway_diff’
git-2.49.0/diff-lib.c:522:12: branch_true: following ‘true’ branch...
 branch_true: ...to here
git-2.49.0/diff-lib.c:525:13: branch_false: following ‘false’ branch (when ‘idx’ is NULL)...
 branch_false: ...to here
git-2.49.0/diff-lib.c:525:13: call_function: calling ‘ce_path_match’ from ‘oneway_diff’
#   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): [#def232]
git-2.49.0/refs.c:201:26: warning[-Wanalyzer-infinite-loop]: infinite loop
git-2.49.0/refs.c:2824:12: enter_function: entry to ‘migrate_one_reflog_entry’
#  199|   
#  200|   	for (cp = refname; ; cp++) {
#  201|-> 		int ch = *cp & 255;
#  202|   		unsigned char disp = refname_disposition[ch];
#  203|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def233]
git-2.49.0/refs/packed-backend.c:1447:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘iter’
git-2.49.0/refs/packed-backend.c:1634:12: enter_function: entry to ‘packed_transaction_prepare’
git-2.49.0/refs/packed-backend.c:1638:41: call_function: calling ‘packed_downcast’ from ‘packed_transaction_prepare’
git-2.49.0/refs/packed-backend.c:1638:41: return_function: returning to ‘packed_transaction_prepare’ from ‘packed_downcast’
git-2.49.0/refs/packed-backend.c:1674:12: branch_false: following ‘false’ branch...
git-2.49.0/refs/packed-backend.c:1677:14: call_function: inlined call to ‘is_lock_file_locked’ from ‘packed_transaction_prepare’
git-2.49.0/refs/packed-backend.c:1677:12: branch_false: following ‘false’ branch...
git-2.49.0/refs/packed-backend.c:1683:13: branch_false: ...to here
git-2.49.0/refs/packed-backend.c:1683:13: call_function: calling ‘write_with_updates’ from ‘packed_transaction_prepare’
# 1445|   			int peel_error = ref_iterator_peel(iter, &peeled);
# 1446|   
# 1447|-> 			if (write_packed_entry(out, iter->refname,
# 1448|   					       iter->oid,
# 1449|   					       peel_error ? NULL : &peeled))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def234]
git-2.49.0/refs/reftable-backend.c:1055:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘arg’
git-2.49.0/refs/reftable-backend.c:1039:12: enter_function: entry to ‘queue_transaction_update’
git-2.49.0/refs/reftable-backend.c:1045:45: release_memory: ‘arg’ is NULL
git-2.49.0/refs/reftable-backend.c:1048:12: branch_false: following ‘false’ branch...
git-2.49.0/refs/reftable-backend.c:1051:15: branch_false: ...to here
git-2.49.0/refs/reftable-backend.c:1051:15: call_function: calling ‘prepare_transaction_update’ from ‘queue_transaction_update’
git-2.49.0/refs/reftable-backend.c:1051:15: return_function: returning to ‘queue_transaction_update’ from ‘prepare_transaction_update’
git-2.49.0/refs/reftable-backend.c:1052:12: branch_false: following ‘false’ branch...
git-2.49.0/refs/reftable-backend.c:1055:9: branch_false: ...to here
git-2.49.0/refs/reftable-backend.c:1055:9: release_memory: ‘arg’ is NULL
git-2.49.0/refs/reftable-backend.c:1055:9: danger: dereference of NULL ‘arg’
# 1053|   		return ret;
# 1054|   
# 1055|-> 	ALLOC_GROW(arg->updates, arg->updates_nr + 1,
# 1056|   		   arg->updates_alloc);
# 1057|   	arg->updates[arg->updates_nr].update = update;

Error: GCC_ANALYZER_WARNING (CWE-122): [#def235]
git-2.49.0/reftable/basics.c:246:9: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
git-2.49.0/reftable/basics.c:217:8: enter_function: entry to ‘parse_names’
git-2.49.0/reftable/basics.c:225:16: branch_true: following ‘true’ branch (when ‘p < end’)...
git-2.49.0/reftable/basics.c:226:30: branch_true: ...to here
git-2.49.0/reftable/basics.c:232:20: branch_true: following ‘true’ branch (when ‘p < next’)...
git-2.49.0/reftable/basics.c:233:29: branch_true: ...to here
git-2.49.0/reftable/basics.c:233:28: branch_true: following ‘true’ branch...
git-2.49.0/reftable/basics.c:233:29: branch_true: ...to here
git-2.49.0/reftable/basics.c:233:29: call_function: calling ‘reftable_alloc_grow’ from ‘parse_names’
git-2.49.0/reftable/basics.c:233:29: return_function: returning to ‘parse_names’ from ‘reftable_alloc_grow’
git-2.49.0/reftable/basics.c:233:29: branch_false: following ‘false’ branch...
git-2.49.0/reftable/basics.c:237:30: branch_false: ...to here
git-2.49.0/reftable/basics.c:237:44: call_function: calling ‘reftable_strdup’ from ‘parse_names’
git-2.49.0/reftable/basics.c:237:44: return_function: returning to ‘parse_names’ from ‘reftable_strdup’
git-2.49.0/reftable/basics.c:238:28: branch_false: following ‘false’ branch...
git-2.49.0/reftable/basics.c:241:17: branch_false: ...to here
git-2.49.0/reftable/basics.c:225:16: branch_false: following ‘false’ branch (when ‘p >= end’)...
git-2.49.0/reftable/basics.c:244:13: branch_false: ...to here
git-2.49.0/reftable/basics.c:244:12: branch_false: following ‘false’ branch...
git-2.49.0/reftable/basics.c:246:14: branch_false: ...to here
git-2.49.0/reftable/basics.c:246:9: danger: out-of-bounds write from byte 8 till byte 15 but region ends at byte 8
#  244|   	if (REFTABLE_ALLOC_GROW(names, names_len + 1, names_cap))
#  245|   		goto err;
#  246|-> 	names[names_len] = NULL;
#  247|   
#  248|   	return names;

Error: GCC_ANALYZER_WARNING (CWE-416): [#def236]
git-2.49.0/reftable/basics.c:252:17: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘names’
git-2.49.0/reftable/basics.c:217:8: enter_function: entry to ‘parse_names’
git-2.49.0/reftable/basics.c:225:16: branch_true: following ‘true’ branch (when ‘p < end’)...
git-2.49.0/reftable/basics.c:226:30: branch_true: ...to here
git-2.49.0/reftable/basics.c:232:20: branch_true: following ‘true’ branch (when ‘p < next’)...
git-2.49.0/reftable/basics.c:233:29: branch_true: ...to here
git-2.49.0/reftable/basics.c:233:28: branch_true: following ‘true’ branch...
git-2.49.0/reftable/basics.c:233:29: branch_true: ...to here
git-2.49.0/reftable/basics.c:233:29: call_function: calling ‘reftable_alloc_grow’ from ‘parse_names’
git-2.49.0/reftable/basics.c:233:29: return_function: returning to ‘parse_names’ from ‘reftable_alloc_grow’
git-2.49.0/reftable/basics.c:233:29: branch_false: following ‘false’ branch...
git-2.49.0/reftable/basics.c:237:30: branch_false: ...to here
git-2.49.0/reftable/basics.c:237:44: call_function: calling ‘reftable_strdup’ from ‘parse_names’
git-2.49.0/reftable/basics.c:237:44: return_function: returning to ‘parse_names’ from ‘reftable_strdup’
git-2.49.0/reftable/basics.c:238:28: branch_false: following ‘false’ branch...
git-2.49.0/reftable/basics.c:241:17: branch_false: ...to here
git-2.49.0/reftable/basics.c:225:16: branch_false: following ‘false’ branch (when ‘p >= end’)...
git-2.49.0/reftable/basics.c:244:13: branch_false: ...to here
git-2.49.0/reftable/basics.c:244:12: branch_true: following ‘true’ branch...
git-2.49.0/reftable/basics.c:244:13: branch_true: ...to here
git-2.49.0/reftable/basics.c:244:13: call_function: calling ‘reftable_alloc_grow’ from ‘parse_names’
git-2.49.0/reftable/basics.c:244:13: return_function: returning to ‘parse_names’ from ‘reftable_alloc_grow’
git-2.49.0/reftable/basics.c:244:13: branch_true: following ‘true’ branch...
git-2.49.0/reftable/basics.c:245:17: branch_true: ...to here
git-2.49.0/reftable/basics.c:251:28: branch_true: following ‘true’ branch (when ‘names_len > i’)...
git-2.49.0/reftable/basics.c:252:36: branch_true: ...to here
git-2.49.0/reftable/basics.c:252:17: danger: use after ‘free’ of ‘names + i * 8’; freed at [(63)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/62)
#  250|   err:
#  251|   	for (size_t i = 0; i < names_len; i++)
#  252|-> 		reftable_free(names[i]);
#  253|   	reftable_free(names);
#  254|   	return NULL;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def237]
git-2.49.0/reftable/blocksource.c:137:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘p’
git-2.49.0/reftable/blocksource.c:107:20: branch_false: following ‘false’ branch...
git-2.49.0/reftable/blocksource.c:110:17: branch_false: ...to here
git-2.49.0/reftable/blocksource.c:134:12: branch_false: following ‘false’ branch...
git-2.49.0/reftable/blocksource.c:136:12: branch_false: ...to here
git-2.49.0/reftable/blocksource.c:136:12: branch_true: following ‘true’ branch (when ‘err != 0’)...
git-2.49.0/reftable/blocksource.c:137:17: branch_true: ...to here
git-2.49.0/reftable/blocksource.c:137:17: danger: use of uninitialized value ‘p’ here
#  135|   		close(fd);
#  136|   	if (err < 0)
#  137|-> 		reftable_free(p);
#  138|   	return 0;
#  139|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def238]
git-2.49.0/reftable/stack.c:351:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cur’
git-2.49.0/reftable/stack.c:633:5: enter_function: entry to ‘reftable_stack_reload’
git-2.49.0/reftable/stack.c:637:24: call_function: calling ‘reftable_stack_reload_maybe_reuse’ from ‘reftable_stack_reload’
#  349|   		}
#  350|   
#  351|-> 		new_readers[new_readers_len] = rd;
#  352|   		new_readers_len++;
#  353|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def239]
git-2.49.0/reftable/stack.c:351:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘new_readers’
git-2.49.0/reftable/stack.c:633:5: enter_function: entry to ‘reftable_stack_reload’
git-2.49.0/reftable/stack.c:637:24: call_function: calling ‘reftable_stack_reload_maybe_reuse’ from ‘reftable_stack_reload’
#  349|   		}
#  350|   
#  351|-> 		new_readers[new_readers_len] = rd;
#  352|   		new_readers_len++;
#  353|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def240]
git-2.49.0/reftable/stack.c:351:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘reused’
git-2.49.0/reftable/stack.c:633:5: enter_function: entry to ‘reftable_stack_reload’
git-2.49.0/reftable/stack.c:637:24: call_function: calling ‘reftable_stack_reload_maybe_reuse’ from ‘reftable_stack_reload’
#  349|   		}
#  350|   
#  351|-> 		new_readers[new_readers_len] = rd;
#  352|   		new_readers_len++;
#  353|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def241]
git-2.49.0/remote.c:1953:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
git-2.49.0/remote.c:1933:20: enter_function: entry to ‘get_expanded_map’
git-2.49.0/remote.c:1938:21: release_memory: ‘ret’ is NULL
git-2.49.0/remote.c:1941:33: branch_true: following ‘true’ branch (when ‘ref’ is non-NULL)...
git-2.49.0/remote.c:1942:23: branch_true: ...to here
git-2.49.0/remote.c:1944:17: call_function: calling ‘strbuf_setlen’ from ‘get_expanded_map’
git-2.49.0/remote.c:1944:17: return_function: returning to ‘get_expanded_map’ from ‘strbuf_setlen’
git-2.49.0/remote.c:1946:20: branch_false: following ‘false’ branch...
git-2.49.0/remote.c:1949:45: branch_false: ...to here
git-2.49.0/remote.c:1941:33: branch_true: following ‘true’ branch (when ‘ref’ is non-NULL)...
git-2.49.0/remote.c:1942:23: branch_true: ...to here
git-2.49.0/remote.c:1944:17: call_function: calling ‘strbuf_setlen’ from ‘get_expanded_map’
git-2.49.0/remote.c:1944:17: return_function: returning to ‘get_expanded_map’ from ‘strbuf_setlen’
git-2.49.0/remote.c:1946:20: branch_false: following ‘false’ branch...
git-2.49.0/remote.c:1949:45: branch_false: ...to here
git-2.49.0/remote.c:1948:20: branch_true: following ‘true’ branch...
git-2.49.0/remote.c:1950:22: branch_true: ...to here
git-2.49.0/remote.c:1948:21: branch_true: following ‘true’ branch...
git-2.49.0/remote.c:1951:43: branch_true: ...to here
git-2.49.0/remote.c:1951:43: call_function: calling ‘copy_ref’ from ‘get_expanded_map’
git-2.49.0/remote.c:1951:43: return_function: returning to ‘get_expanded_map’ from ‘copy_ref’
git-2.49.0/remote.c:1953:29: danger: dereference of NULL ‘copy_ref(ref)’
# 1951|   			struct ref *cpy = copy_ref(ref);
# 1952|   
# 1953|-> 			if (cpy->peer_ref)
# 1954|   				free_one_ref(cpy->peer_ref);
# 1955|   			cpy->peer_ref = alloc_ref(expn_name);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def242]
git-2.49.0/run-command.c:343:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fd,  to)’
git-2.49.0/run-command.c:1856:22: enter_function: entry to ‘start_bg_command’
git-2.49.0/run-command.c:1873:12: branch_false: following ‘false’ branch...
git-2.49.0/run-command.c:1876:14: branch_false: ...to here
git-2.49.0/run-command.c:1879:15: call_function: calling ‘start_command’ from ‘start_bg_command’
#  341|   static void child_dup2(int fd, int to)
#  342|   {
#  343|-> 	if (dup2(fd, to) < 0)
#  344|   		child_die(CHILD_ERR_DUP2);
#  345|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def243]
git-2.49.0/strbuf.c:116:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
git-2.49.0/strbuf.c:1049:6: enter_function: entry to ‘strbuf_stripspace’
git-2.49.0/strbuf.c:1056:9: call_function: calling ‘strbuf_grow’ from ‘strbuf_stripspace’
#  114|   	ALLOC_GROW(sb->buf, sb->len + extra + 1, sb->alloc);
#  115|   	if (new_buf)
#  116|-> 		sb->buf[0] = '\0';
#  117|   }
#  118|   

Error: CPPCHECK_WARNING (CWE-457): [#def244]
git-2.49.0/t/unit-tests/clar/clar.c:392: warning[uninitvar]: Uninitialized variable: matchlen
#  390|   			continue;
#  391|   
#  392|-> 		if (exact && strlen(test[i].name) != matchlen)
#  393|   			continue;
#  394|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def245]
git-2.49.0/t/unit-tests/clar/clar/summary.h:73:12: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "w")’
git-2.49.0/t/unit-tests/clar/clar/summary.h:69:19: acquire_resource: opened here
git-2.49.0/t/unit-tests/clar/clar/summary.h:69:12: branch_false: following ‘false’ branch...
git-2.49.0/t/unit-tests/clar/clar/summary.h:73:24: branch_false: ...to here
git-2.49.0/t/unit-tests/clar/clar/summary.h:73:12: danger: ‘fopen(filename, "w")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   71|   			   filename, strerror(errno));
#   72|   
#   73|-> 	if ((summary = malloc(sizeof(struct clar_summary))) == NULL)
#   74|   		clar_abort("Failed to allocate summary.\n");
#   75|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def246]
git-2.49.0/t/unit-tests/clar/clar/summary.h:73:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "w")’
git-2.49.0/t/unit-tests/clar/clar/summary.h:69:19: acquire_memory: allocated here
git-2.49.0/t/unit-tests/clar/clar/summary.h:69:12: branch_false: following ‘false’ branch...
git-2.49.0/t/unit-tests/clar/clar/summary.h:73:24: branch_false: ...to here
git-2.49.0/t/unit-tests/clar/clar/summary.h:73:12: danger: ‘fopen(filename, "w")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   71|   			   filename, strerror(errno));
#   72|   
#   73|-> 	if ((summary = malloc(sizeof(struct clar_summary))) == NULL)
#   74|   		clar_abort("Failed to allocate summary.\n");
#   75|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def247]
git-2.49.0/t/unit-tests/t-reftable-basics.c:156:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
git-2.49.0/t/unit-tests/t-reftable-basics.c:28:5: enter_function: entry to ‘cmd_main’
git-2.49.0/t/unit-tests/t-reftable-basics.c:149:9: branch_false: following ‘false’ branch...
git-2.49.0/t/unit-tests/t-reftable-basics.c:149:9: branch_false: ...to here
git-2.49.0/t/unit-tests/t-reftable-basics.c:153:17: call_function: calling ‘reftable_alloc_grow’ from ‘cmd_main’
git-2.49.0/t/unit-tests/t-reftable-basics.c:153:17: return_function: returning to ‘cmd_main’ from ‘reftable_alloc_grow’
git-2.49.0/t/unit-tests/t-reftable-basics.c:153:17: branch_false: following ‘false’ branch...
git-2.49.0/t/unit-tests/t-reftable-basics.c:153:17: branch_false: ...to here
git-2.49.0/t/unit-tests/t-reftable-basics.c:156:17: danger: dereference of NULL ‘reftable_alloc_grow(0, 1, 4, &alloc)’
#  154|   		check(arr != NULL);
#  155|   		check_uint(alloc, >=, 1);
#  156|-> 		arr[0] = 42;
#  157|   
#  158|   		old_alloc = alloc;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def248]
git-2.49.0/t/unit-tests/t-reftable-basics.c:182:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘arr’
git-2.49.0/t/unit-tests/t-reftable-basics.c:28:5: enter_function: entry to ‘cmd_main’
git-2.49.0/t/unit-tests/t-reftable-basics.c:175:9: branch_false: following ‘false’ branch...
git-2.49.0/t/unit-tests/t-reftable-basics.c:175:9: branch_false: ...to here
git-2.49.0/t/unit-tests/t-reftable-basics.c:179:17: call_function: calling ‘reftable_alloc_grow’ from ‘cmd_main’
git-2.49.0/t/unit-tests/t-reftable-basics.c:179:17: return_function: returning to ‘cmd_main’ from ‘reftable_alloc_grow’
git-2.49.0/t/unit-tests/t-reftable-basics.c:179:17: branch_true: following ‘true’ branch...
git-2.49.0/t/unit-tests/t-reftable-basics.c:179:17: branch_true: ...to here
git-2.49.0/t/unit-tests/t-reftable-basics.c:182:17: danger: dereference of NULL ‘arr’
#  180|   		check(arr != NULL);
#  181|   		check_uint(alloc, >=, 1);
#  182|-> 		arr[0] = 42;
#  183|   
#  184|   		old_alloc = alloc;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def249]
git-2.49.0/t/unit-tests/t-reftable-merged.c:182:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘out’
git-2.49.0/t/unit-tests/t-reftable-merged.c:104:13: enter_function: entry to ‘t_merged_refs’
git-2.49.0/t/unit-tests/t-reftable-merged.c:159:17: call_function: calling ‘merged_table_from_records’ from ‘t_merged_refs’
git-2.49.0/t/unit-tests/t-reftable-merged.c:159:17: return_function: returning to ‘t_merged_refs’ from ‘merged_table_from_records’
git-2.49.0/t/unit-tests/t-reftable-merged.c:175:16: branch_true: following ‘true’ branch (when ‘len != 100’)...
git-2.49.0/t/unit-tests/t-reftable-merged.c:176:44: branch_true: ...to here
git-2.49.0/t/unit-tests/t-reftable-merged.c:178:20: branch_false: following ‘false’ branch...
git-2.49.0/t/unit-tests/t-reftable-merged.c:181:17: branch_false: ...to here
git-2.49.0/t/unit-tests/t-reftable-merged.c:181:17: branch_false: following ‘false’ branch...
git-2.49.0/t/unit-tests/t-reftable-merged.c:181:17: branch_false: ...to here
git-2.49.0/t/unit-tests/t-reftable-merged.c:181:17: call_function: calling ‘reftable_alloc_grow’ from ‘t_merged_refs’
git-2.49.0/t/unit-tests/t-reftable-merged.c:181:17: return_function: returning to ‘t_merged_refs’ from ‘reftable_alloc_grow’
git-2.49.0/t/unit-tests/t-reftable-merged.c:181:17: branch_false: following ‘false’ branch...
git-2.49.0/t/unit-tests/t-reftable-merged.c:181:17: branch_false: ...to here
git-2.49.0/t/unit-tests/t-reftable-merged.c:182:20: release_memory: ‘out’ is NULL
git-2.49.0/t/unit-tests/t-reftable-merged.c:182:17: danger: dereference of NULL ‘out + len * 96’
#  180|   
#  181|   		check(!REFTABLE_ALLOC_GROW(out, len + 1, cap));
#  182|-> 		out[len++] = ref;
#  183|   	}
#  184|   	reftable_iterator_destroy(&it);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def250]
git-2.49.0/t/unit-tests/t-reftable-merged.c:463:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘out’
git-2.49.0/t/unit-tests/t-reftable-merged.c:380:13: enter_function: entry to ‘t_merged_logs’
git-2.49.0/t/unit-tests/t-reftable-merged.c:439:44: call_function: calling ‘merged_table_from_log_records’ from ‘t_merged_logs’
git-2.49.0/t/unit-tests/t-reftable-merged.c:439:44: return_function: returning to ‘t_merged_logs’ from ‘merged_table_from_log_records’
git-2.49.0/t/unit-tests/t-reftable-merged.c:456:16: branch_true: following ‘true’ branch (when ‘len != 100’)...
git-2.49.0/t/unit-tests/t-reftable-merged.c:457:44: branch_true: ...to here
git-2.49.0/t/unit-tests/t-reftable-merged.c:459:20: branch_false: following ‘false’ branch...
git-2.49.0/t/unit-tests/t-reftable-merged.c:462:17: branch_false: ...to here
git-2.49.0/t/unit-tests/t-reftable-merged.c:462:17: branch_false: following ‘false’ branch...
git-2.49.0/t/unit-tests/t-reftable-merged.c:462:17: branch_false: ...to here
git-2.49.0/t/unit-tests/t-reftable-merged.c:462:17: call_function: calling ‘reftable_alloc_grow’ from ‘t_merged_logs’
git-2.49.0/t/unit-tests/t-reftable-merged.c:462:17: return_function: returning to ‘t_merged_logs’ from ‘reftable_alloc_grow’
git-2.49.0/t/unit-tests/t-reftable-merged.c:462:17: branch_false: following ‘false’ branch...
git-2.49.0/t/unit-tests/t-reftable-merged.c:462:17: branch_false: ...to here
git-2.49.0/t/unit-tests/t-reftable-merged.c:463:20: release_memory: ‘out’ is NULL
git-2.49.0/t/unit-tests/t-reftable-merged.c:463:17: danger: dereference of NULL ‘out + len * 144’
#  461|   
#  462|   		check(!REFTABLE_ALLOC_GROW(out, len + 1, cap));
#  463|-> 		out[len++] = log;
#  464|   	}
#  465|   	reftable_iterator_destroy(&it);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def251]
git-2.49.0/tempfile.c:274:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopen(*tempfile.fd,  mode)’
git-2.49.0/tempfile.c:268:12: branch_false: following ‘false’ branch (when ‘tempfile’ is non-NULL)...
git-2.49.0/tempfile.c:270:13: branch_false: ...to here
git-2.49.0/tempfile.c:270:12: branch_false: following ‘false’ branch...
git-2.49.0/tempfile.c:273:31: branch_false: ...to here
git-2.49.0/tempfile.c:273:24: acquire_memory: allocated here
git-2.49.0/tempfile.c:274:16: danger: ‘fdopen(*tempfile.fd,  mode)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  272|   
#  273|   	tempfile->fp = fdopen(tempfile->fd, mode);
#  274|-> 	return tempfile->fp;
#  275|   }
#  276|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def252]
git-2.49.0/tempfile.c:333:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*tempfile.filename.buf, 513)’
git-2.49.0/tempfile.c:328:12: branch_false: following ‘false’ branch (when ‘tempfile’ is non-NULL)...
git-2.49.0/tempfile.c:330:18: branch_false: ...to here
git-2.49.0/tempfile.c:330:12: branch_false: following ‘false’ branch...
git-2.49.0/tempfile.c:332:29: branch_false: ...to here
git-2.49.0/tempfile.c:332:24: acquire_resource: opened here
git-2.49.0/tempfile.c:333:16: danger: ‘open(*tempfile.filename.buf, 513)’ leaks here; was opened at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  331|   		BUG("reopen_tempfile called for an open object");
#  332|   	tempfile->fd = open(tempfile->filename.buf, O_WRONLY|O_TRUNC);
#  333|-> 	return tempfile->fd;
#  334|   }
#  335|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def253]
git-2.49.0/unpack-trees.c:2332:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ce’
git-2.49.0/unpack-trees.c:3019:5: enter_function: entry to ‘oneway_merge’
git-2.49.0/unpack-trees.c:3025:12: branch_false: following ‘false’ branch...
git-2.49.0/unpack-trees.c:3029:12: branch_false: ...to here
git-2.49.0/unpack-trees.c:3030:24: call_function: calling ‘deleted_entry’ from ‘oneway_merge’
# 2330|   	int cnt = 0;
# 2331|   
# 2332|-> 	if (S_ISGITLINK(ce->ce_mode)) {
# 2333|   		struct object_id oid;
# 2334|   		int sub_head = repo_resolve_gitlink_ref(the_repository, ce->name,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def254]
git-2.49.0/utf8.c:137:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘s’
git-2.49.0/utf8.c:791:5: enter_function: entry to ‘is_hfs_dotmailmap’
git-2.49.0/utf8.c:793:16: call_function: calling ‘is_hfs_dot_str’ from ‘is_hfs_dotmailmap’
#  135|   	if (remainder < 1) {
#  136|   		goto invalid;
#  137|-> 	} else if (*s < 0x80) {
#  138|   		/* 0xxxxxxx */
#  139|   		ch = *s;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def255]
git-2.49.0/worktree.c:936:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(gitdir.buf, 0)’
git-2.49.0/worktree.c:915:12: branch_false: following ‘false’ branch...
git-2.49.0/worktree.c:920:9: branch_false: ...to here
git-2.49.0/worktree.c:921:12: branch_false: following ‘false’ branch...
git-2.49.0/worktree.c:924:18: branch_false: ...to here
git-2.49.0/worktree.c:924:12: branch_false: following ‘false’ branch...
git-2.49.0/worktree.c:929:19: branch_false: ...to here
git-2.49.0/worktree.c:929:14: acquire_resource: opened here
git-2.49.0/worktree.c:930:12: branch_false: following ‘false’ branch...
git-2.49.0/worktree.c:936:23: branch_false: ...to here
git-2.49.0/worktree.c:936:23: danger: ‘open(gitdir.buf, 0)’ leaks here; was opened at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  934|   		goto done;
#  935|   	}
#  936|-> 	len = xsize_t(st.st_size);
#  937|   	path = xmallocz(len);
#  938|   

Scan Properties

analyzer-version-clippy1.86.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.0.1
analyzer-version-gcc-analyzer15.0.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-148.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namegit-2.49.0-2.fc43
store-results-to/tmp/tmpd_5c2d7m/git-2.49.0-2.fc43.tar.xz
time-created2025-04-25 12:51:30
time-finished2025-04-25 12:58:10
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmpd_5c2d7m/git-2.49.0-2.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpd_5c2d7m/git-2.49.0-2.fc43.src.rpm'
tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9