@matheusbsbs / matheus-bagliano / commits / dc6716b83d
Fork 0

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>

Shawn O. Pearce committed Apr 29, 2007 at 01:54 UTC dc6716b83d3f90f8b1b2c611fe4f9f7c9fb14f5e
1 file changed +12 -11
git-gui.sh
+12 -11
@@ -1298,12 +1298,12 @@ A rescan will be automatically started now.
1298
1299 # -- Create the commit.
1300 #
1301 - set cmd [list git commit-tree $tree_id]
1301 + set cmd [list commit-tree $tree_id]
1302 foreach p [concat $PARENT $MERGE_HEAD] {
1303 lappend cmd -p $p
1304 }
1305 lappend cmd <$msg_p
1306 - if {[catch {set cmt_id [eval exec $cmd]} err]} {
1306 + if {[catch {set cmt_id [eval git $cmd]} err]} {
1307 error_popup "commit-tree failed:\n\n$err"
1308 set ui_status_value {Commit failed.}
1309 unlock_index
@@ -1323,8 +1323,9 @@ A rescan will be automatically started now.
1323 set subject $msg
1324 }
1325 append reflogm {: } $subject
1326 - set cmd [list git update-ref -m $reflogm HEAD $cmt_id $curHEAD]
1327 - if {[catch {eval exec $cmd} err]} {
1326 + if {[catch {
1327 + git update-ref -m $reflogm HEAD $cmt_id $curHEAD
1328 + } err]} {
1329 error_popup "update-ref failed:\n\n$err"
1330 set ui_status_value {Commit failed.}
1331 unlock_index
@@ -2018,13 +2019,13 @@ proc do_create_branch_action {w} {
2019 -message "Invalid starting revision: $rev"
2020 return
2021 }
2021 - set cmd [list git update-ref]
2022 - lappend cmd -m
2023 - lappend cmd "branch: Created from $rev"
2024 - lappend cmd "refs/heads/$newbranch"
2025 - lappend cmd $cmt
2026 - lappend cmd $null_sha1
2027 - if {[catch {eval exec $cmd} err]} {
2022 + if {[catch {
2023 + git update-ref \
2024 + -m "branch: Created from $rev" \
2025 + "refs/heads/$newbranch" \
2026 + $cmt \
2027 + $null_sha1
2028 + } err]} {
2029 tk_messageBox \
2030 -icon error \
2031 -type ok \