mirror of
https://github.com/dolthub/dolt.git
synced 2026-04-23 05:13:00 -05:00
Documented the behavior of getOperation and updated existing test to match that behavior (missing key is a non-zero return value, per git behavior)
This commit is contained in:
@@ -83,6 +83,8 @@ func processConfigCommand(dEnv *env.DoltEnv, setCfgTypes *set.StrSet, opName str
|
||||
panic("New operation added but not implemented.")
|
||||
}
|
||||
|
||||
// Gets the config value for the key requested in the args, running the printFn given with the key and fetched value as
|
||||
// arguments. If the key is not found, or if there is an error retrieving it, returns 1. Otherwise returns 0.
|
||||
func getOperation(dEnv *env.DoltEnv, setCfgTypes *set.StrSet, args []string, printFn func(string, *string)) int {
|
||||
if len(args) != 1 {
|
||||
// matches git behavior... kinda dumb
|
||||
|
||||
@@ -93,8 +93,8 @@ func TestConfig(t *testing.T) {
|
||||
}
|
||||
})
|
||||
|
||||
if ret != 0 {
|
||||
t.Error("get operation failed")
|
||||
if ret == 0 {
|
||||
t.Error("get operation should return 1 for a key not found")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user