Skip to content

Commit 2217503

Browse files
committed
add trailing directory separator and proper channel setup to prevent stalling of request (resolves #107)
1 parent c45c15a commit 2217503

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

git/git_fetch.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func windowsFetch(repoPath string, remoteName string, branch string) *model.Fetc
3434
FetchedItems: nil,
3535
}
3636
} else {
37-
logger.Log(fmt.Sprintf("Changes fetch from remote - %s -> %s", remoteName, cmdStr), global.StatusInfo)
37+
logger.Log(fmt.Sprintf("Changes fetched from remote - %s -> %s", remoteName, cmdStr), global.StatusInfo)
3838

3939
msg := fmt.Sprintf("Changes fetched from %v", remoteName)
4040
return &model.FetchResult{
@@ -118,7 +118,8 @@ func FetchFromRemote(repo *git.Repository, remoteURL string, remoteBranch string
118118
} else {
119119
logger.Log(b.String(), global.StatusInfo)
120120
logger.Log("Changes fetched from remote", global.StatusInfo)
121-
msg := fmt.Sprintf("Changes fetched from %v", git.DefaultRemoteName)
121+
122+
msg := fmt.Sprintf("Changes fetched from remote %v", remoteName)
122123
return &model.FetchResult{
123124
Status: "CHANGES FETCHED FROM REMOTE",
124125
FetchedItems: []*string{&msg},

git/git_ls_files.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var waitGroup sync.WaitGroup
2828

2929
// DirCommitHandler collects the commit messages for the directories present in the target repo
3030
func DirCommitHandler(dirName *string, repoPath string, fileChan chan string, commitChan chan string, waitGroup *sync.WaitGroup) {
31-
args := []string{"log", "--oneline", "-1", "--pretty=format:%s", *dirName}
31+
args := []string{"log", "--oneline", "-1", "--pretty=format:%s", *dirName + "/"}
3232
cmd := utils.GetGitClient(repoPath, args)
3333

3434
if cmd.String() != "" {
@@ -38,6 +38,8 @@ func DirCommitHandler(dirName *string, repoPath string, fileChan chan string, co
3838
if err != nil {
3939
logger.Log(fmt.Sprintf("Command execution for -> {{%s}} failed with error %v", cmd.String(), err.Error()), global.StatusError)
4040
fmt.Println(commitLog)
41+
fileChan <- ""
42+
commitChan <- ""
4143
waitGroup.Done()
4244
} else {
4345
commitMsg := string(commitLog)

0 commit comments

Comments
 (0)