在我的Android Studio中,更改某行中的文本会在diff中显示整个文件。以前,这可以正常工作;现在不起作用。
我对设置进行了多次更改,所以我无法确定罪魁祸首。我在Android Studio中添加了自己的格式化程序-不知道这是否引起了问题。
下面我附加了示例git diff
输出:
@@ -1 +1 @@
-package com.gyanapp.Base;^Mimport android.os.Bundle;^Mimport android.support.annotation.Nullable;^Mimport com.AppVersionModel;^Mimport com.OTPApi;^Mimport com.gyanapp.Screens.ForceUpgrade.Forc
eUpgradeScreen;^Mimport com.gyanapp.Utils.DeviceUtils;^Mimport com.gyanapp.Utils.NetWorkUtil;^Mimport io.reactivex.android.schedulers.AndroidSchedulers;^Mimport io.reactivex.observers.Disposabl
eObserver;^Mimport io.reactivex.schedulers.Schedulers;^M/**^M * Created by Utkarsh Shukla on 03/11/18.^M */^Mpublic abstract class BaseForceUpdradeCheck extends BaseActivity {^M @Override^M
public abstract void logScreenFlowEventForAnalytics() ;^M @Override^M protected void onCreate(@Nullable Bundle savedInstanceState) {^M super.onCreate(savedInstanceState);^M
DisposableObserver<AppVersionModel> disposableObserver =^M new DisposableObserver<AppVersionModel>() {^M @Override^M public void onNext(
AppVersionModel appVersionModel) {^M if (DeviceUtils.requireForceUpgrade(appVersionModel)) {^M startActivity(ForceUpgradeScreen.createIntent(Ba
seForceUpdradeCheck.this));^M finish();^M } else {^M continueNormalProcess();^M }^M//
continueNormalProcess();^M }^M @Override^M public void onError(Throwable e) {^M }^M @Override^M public void onComplete() {^M }^M };^M DisposableObserver<AppVersionModel> homeResponseDisposableObserver =^M NetWorkUtil.provideRetrofit().create(OTPApi.class).checkAppVersion()^M .subscribeOn(Schedulers^M .io())^M .observeOn(AndroidSchedulers.mainThread())^M .subscribeWith(disposableObserver);^M }^M protected abstract void continueNormalProcess();^M}
\ No newline at end of file
+package com.gyanapp.Base;^Mimport android.os.Bundle;^Mimport android.support.annotation.Nullable;^Mimport com.AppVersionModel;^Mimport com.OTPApi;^Mimport com.google.firebase.perf.FirebasePerformance;^Mimport com.google.firebase.perf.metrics.Trace;^Mimport com.gyanapp.Screens.ForceUpgrade.ForceUpgradeScreen;^Mimport com.gyanapp.Utils.Config;^Mimport com.gyanapp.Utils.DeviceUtils;^Mimport com.gyanapp.Utils.NetWorkUtil;^Mimport io.reactivex.android.schedulers.AndroidSchedulers;^Mimport io.reactivex.observers.DisposableObserver;^Mimport io.reactivex.schedulers.Schedulers;^M/**^M * Created by Utkarsh Shukla on 03/11/18.^M */^Mpublic abstract class BaseForceUpdradeCheck extends BaseActivity {^M @Override^M public abstract void logScreenFlowEventForAnalytics() ;^M @Override^M protected void onCreate(@Nullable Bundle savedInstanceState) {^M super.onCreate(savedInstanceState);^M Trace myTrace = FirebasePerformance.getInstance().newTrace(Config.TRACE.SPLASH_FORCE_UPGRADE_CHECK_CALL);^M myTrace.start();^M DisposableObserver<AppVersionModel> disposableObserver =^M new DisposableObserver<AppVersionModel>() {^M @Override^M public void onNext(AppVersionModel appVersionModel) {^M myTrace.incrementMetric(Config.TRACE.SPLASH_FORCE_UPGRADE_CHECK_CALL_SUCCESS,1);^M myTrace.stop();^M if (DeviceUtils.requireForceUpgrade(appVersionModel)) {^M startActivity(ForceUpgradeScreen.createIntent(BaseForceUpdradeCheck.this));^M finish();^M } else {^M continueNormalProcess();
^M }^M }^M @Override^M public void onError(Throwable e) {^M myTrace.incrementMetric(Config.TRACE.SPLASH_FORCE_UPGRADE_CHECK_CALL_ERROR,1);^M myTrace.stop();^M }^M @Override^M public void onComplete() {^M^M }^M };^M DisposableObserver<AppVersionModel> homeResponseDisposableObserver =^M NetWorkUtil.provideRetrofit().create(OTPApi.class).checkAppVersion()^M .subscribeOn(Schedulers^M .io())^M .observeOn(AndroidSchedulers.mainThread())^M .subscribeWith(disposableObserver);^M }^M protected abstract void continueNormalProcess();^M}^M
\ No newline at end of file
ˆM
是什么?什么是No newline at end of file
?
尝试了this,但没有成功