Skip to content

Commit ba737a9

Browse files
authored
Merge pull request #25 from dtaniwaki/handle-empty-branch
Handle empty branches
2 parents ca95214 + 78fc572 commit ba737a9

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

pkg/ghost/types/branchspec.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,6 @@ func (bs CommitsBranchSpec) CreateBranch(we WorkingEnv) (GhostBranch, errors.Git
134134

135135
commitHashFrom := resolved.CommittishFrom
136136
commitHashTo := resolved.CommittishTo
137-
if commitHashFrom == commitHashTo {
138-
return nil, nil
139-
}
140-
141137
branch := CommitsBranch{
142138
Prefix: resolved.Prefix,
143139
CommitHashFrom: commitHashFrom,
@@ -257,15 +253,6 @@ func (bs DiffBranchSpec) CreateBranch(we WorkingEnv) (GhostBranch, errors.GitGho
257253
}
258254
}
259255

260-
size, err := util.FileSize(tmpFile.Name())
261-
if err != nil {
262-
return nil, errors.WithStack(err)
263-
}
264-
265-
if size == 0 {
266-
return nil, nil
267-
}
268-
269256
hash, err := util.GenerateFileContentHash(tmpFile.Name())
270257
if err != nil {
271258
return nil, errors.WithStack(err)

0 commit comments

Comments
 (0)