Skip to content

Commit

Permalink
fix: not catching all checkout conflict exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ViscousPot committed Dec 18, 2024
1 parent 3627b8d commit 70d0939
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/src/main/java/com/viscouspot/gitsync/util/GitManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import org.eclipse.jgit.api.errors.JGitInternalException
import org.eclipse.jgit.api.errors.WrongRepositoryStateException
import org.eclipse.jgit.diff.DiffFormatter
import org.eclipse.jgit.errors.CheckoutConflictException
import org.eclipse.jgit.api.errors.CheckoutConflictException as ApiCheckoutConflictException
import org.eclipse.jgit.errors.NotSupportedException
import org.eclipse.jgit.errors.TransportException
import org.eclipse.jgit.internal.JGitText
Expand Down Expand Up @@ -226,7 +227,10 @@ class GitManager(private val context: Context, private val settingsManager: Sett
} catch (e: CheckoutConflictException) {
log(LogType.PullFromRepo, e.stackTraceToString())
return false
} catch (e: WrongRepositoryStateException) {
}catch (e: ApiCheckoutConflictException) {
log(LogType.PullFromRepo, e.stackTraceToString())
return false
} catch (e: WrongRepositoryStateException) {
if (e.message?.contains(context.getString(R.string.merging_exception_message)) == true) {
log(LogType.PullFromRepo, "Merge conflict")
return false
Expand Down

0 comments on commit 70d0939

Please sign in to comment.