diff options
| author | Teddy Wing | 2014-12-06 18:54:34 -0500 | 
|---|---|---|
| committer | Teddy Wing | 2014-12-06 18:54:34 -0500 | 
| commit | b6b8d7d8b78f1c8e5de43732446051aa40673c07 (patch) | |
| tree | 8b3a420c5c22a5b9e98c1493cced823b4767afaa | |
| parent | cd4a62fbbd0d8f89c6ab7e9e0d92d86f3442cfbd (diff) | |
| download | git-checkout-history-b6b8d7d8b78f1c8e5de43732446051aa40673c07.tar.bz2 | |
git-checkout-history: Store branches in checkout historyv0.0.1
When checking out a branch using the git-checkout-history shorthand,
store the newly checked out branch in history.
| -rw-r--r-- | git-checkout-history/main.go | 4 | 
1 files changed, 4 insertions, 0 deletions
| diff --git a/git-checkout-history/main.go b/git-checkout-history/main.go index 8bf6e24..5d8351b 100644 --- a/git-checkout-history/main.go +++ b/git-checkout-history/main.go @@ -2,6 +2,7 @@ package main  import (  	"fmt" +	"github.com/teddywing/git-checkout-history/utils"  	"io/ioutil"  	"log"  	"os" @@ -44,11 +45,14 @@ func main() {  	if len(args) > 0 {  		branchIndex, _ := strconv.Atoi(args[0]) +		  		cmd := exec.Command("git", "checkout", branchList.Branches[branchIndex])  		err := cmd.Run()  		if err != nil {  			fmt.Fprintf(os.Stderr, err.Error())  		} +		 +		utils.Store(branchList.Branches[branchIndex])  	} else {  		// List branches in history  		for i := 1; i < len(branchList.Branches); i++ { | 
