Anonymous avatar Anonymous committed dc6716b

git-gui: Refactor to use our git proc more often

Whenever we want to execute a git subcommand from the plumbing
layer (and on rare occasion, the more porcelain-ish layer) we
tend to use our proc wrapper, just to make the code slightly
cleaner at the call sites. I wasn't doing that in a couple of
places, so this is a simple cleanup to correct that.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>;

Comments (0)

Files changed (1)

 
 	# -- Create the commit.
 	#
-	set cmd [list git commit-tree $tree_id]
+	set cmd [list commit-tree $tree_id]
 	foreach p [concat $PARENT $MERGE_HEAD] {
 		lappend cmd -p $p
 	}
 	lappend cmd <$msg_p
-	if {[catch {set cmt_id [eval exec $cmd]} err]} {
+	if {[catch {set cmt_id [eval git $cmd]} err]} {
 		error_popup "commit-tree failed:\n\n$err"
 		set ui_status_value {Commit failed.}
 		unlock_index
 		set subject $msg
 	}
 	append reflogm {: } $subject
-	set cmd [list git update-ref -m $reflogm HEAD $cmt_id $curHEAD]
-	if {[catch {eval exec $cmd} err]} {
+	if {[catch {
+			git update-ref -m $reflogm HEAD $cmt_id $curHEAD
+		} err]} {
 		error_popup "update-ref failed:\n\n$err"
 		set ui_status_value {Commit failed.}
 		unlock_index
 			-message "Invalid starting revision: $rev"
 		return
 	}
-	set cmd [list git update-ref]
-	lappend cmd -m
-	lappend cmd "branch: Created from $rev"
-	lappend cmd "refs/heads/$newbranch"
-	lappend cmd $cmt
-	lappend cmd $null_sha1
-	if {[catch {eval exec $cmd} err]} {
+	if {[catch {
+			git update-ref \
+				-m "branch: Created from $rev" \
+				"refs/heads/$newbranch" \
+				$cmt \
+				$null_sha1
+		} err]} {
 		tk_messageBox \
 			-icon error \
 			-type ok \
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.